Permalink
Browse files

SWITCHYARD-1229 Remove support for JBoss AS 6

  • Loading branch information...
1 parent 808f6c7 commit 41d4042759f6985ef1abb833a2f30ffc5d21b171 @kcbabo kcbabo committed Dec 28, 2012
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ JBoss, Home of Professional Open Source.
- ~ Copyright 2010, Red Hat, Inc., and individual contributors
- ~ as indicated by the @author tags. See the copyright.txt file in the
- ~ distribution for a full listing of individual contributors.
- ~
- ~ This is free software; you can redistribute it and/or modify it
- ~ under the terms of the GNU Lesser General Public License as
- ~ published by the Free Software Foundation; either version 2.1 of
- ~ the License, or (at your option) any later version.
- ~
- ~ This software is distributed in the hope that it will be useful,
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- ~ Lesser General Public License for more details.
- ~
- ~ You should have received a copy of the GNU Lesser General Public
- ~ License along with this software; if not, write to the Free
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- -->
-
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.switchyard</groupId>
- <artifactId>switchyard-as6-parent</artifactId>
- <version>0.7.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.switchyard</groupId>
- <artifactId>switchyard-deploy-jboss-as6</artifactId>
-
- <packaging>jar</packaging>
- <name>SwitchYard: JBoss AS6 Deployer</name>
- <description>The JBoss AS6 Deployer Implementation</description>
- <url>http://switchyard.org</url>
-
- <dependencies>
- <dependency>
- <groupId>org.switchyard</groupId>
- <artifactId>switchyard-config</artifactId>
- </dependency>
- <dependency>
- <groupId>org.switchyard</groupId>
- <artifactId>switchyard-deploy</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>weld-int-deployer</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>weld-int-ejb</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jboss.ejb3.instantiator</groupId>
- <artifactId>jboss-ejb3-instantiator-deployer</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-</project>
@@ -1,147 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
- * as indicated by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-package org.switchyard.deployment;
-
-import org.apache.log4j.Logger;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.DeploymentUnitVisitor;
-import org.jboss.weld.integration.util.IdFactory;
-import org.switchyard.deploy.internal.AbstractDeployment;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.StringRefAddr;
-
-/**
- * CDI BeanManager JNDI deployer.
- *
- * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a>
- */
-public class CDIBeanManagerJNDIDeployer extends AbstractRealDeployer {
-
- private static Logger _logger = Logger.getLogger(CDIBeanManagerJNDIDeployer.class);
-
- /**
- * Public default constructor.
- */
- public CDIBeanManagerJNDIDeployer() {
- setStage(DeploymentStages.PRE_REAL);
- }
-
- @Override
- protected void internalDeploy(DeploymentUnit unit) throws DeploymentException {
- if (isSwitchYardDeployment(unit)) {
- unit.visit(new BinderVisitor());
- }
- }
-
- @Override
- protected void internalUndeploy(DeploymentUnit unit) {
- if (isSwitchYardDeployment(unit)) {
- try {
- unit.visit(new UnbinderVisitor());
- } catch (DeploymentException e) {
- _logger.debug("Deployment error undeploying " + unit.getSimpleName());
- }
- }
- }
-
- private boolean isSwitchYardDeployment(DeploymentUnit unit) {
- return (unit.getClassLoader().getResource(AbstractDeployment.SWITCHYARD_XML) != null);
- }
-
- private class BinderVisitor implements DeploymentUnitVisitor {
-
- public void visit(DeploymentUnit unit) throws DeploymentException {
- if (unit.isTopLevel()) {
- Context javaComp = getJavaComp(unit);
-
- try {
- Reference reference = new Reference("javax.enterprise.inject.spi.BeanManager", "org.jboss.weld.integration.deployer.jndi.JBossBeanManagerObjectFactory", null);
- reference.add(new StringRefAddr("id", IdFactory.getIdFromClassLoader(unit.getClassLoader())));
- javaComp.bind("BeanManager", reference);
- _logger.debug("CDI BeanManager successfully bound into JNDI (java:comp) for SwitchYard deployment '" + unit.getName() + "'.");
- } catch (NamingException e) {
- throw new DeploymentException("Error binding BeanManager.", e);
- }
- }
- }
-
-
- public void error(DeploymentUnit unit) {
- // TODO: Any info on the error please?
- _logger.debug("Deployment error deploying " + unit.getSimpleName());
- }
-
- }
-
- private class UnbinderVisitor implements DeploymentUnitVisitor {
-
- public void visit(DeploymentUnit unit) throws DeploymentException {
- if (unit.isTopLevel()) {
- try {
- Context javaComp = getJavaComp(unit);
- javaComp.unbind("BeanManager");
- _logger.debug("CDI BeanManager successfully unbound from JNDI (java:comp) for SwitchYard deployment '" + unit.getName() + "'.");
- } catch (NamingException e) {
- throw new DeploymentException("Error unbinding BeanManager.", e);
- }
- }
- }
-
- public void error(DeploymentUnit unit) {
- // TODO: Any info on the error please?
- _logger.debug("Deployment error undeploying " + unit.getSimpleName());
- }
- }
-
- private Context getJavaComp(DeploymentUnit unit) throws DeploymentException {
- Context javaComp = null;
- InitialContext initialContext = null;
-
- ClassLoader originalTCCL = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(unit.getClassLoader());
- initialContext = new InitialContext();
- javaComp = (Context) initialContext.lookup("java:comp");
- } catch (Exception e) {
- throw new DeploymentException("Unexpected retrieving java:comp from JNDI namespace.", e);
- } finally {
- try {
- if (initialContext != null) {
- try {
- initialContext.close();
- } catch (NamingException e) {
- throw new DeploymentException("Unexpected error closing InitialContext.", e);
- }
- }
- } finally {
- Thread.currentThread().setContextClassLoader(originalTCCL);
- }
- }
-
- return javaComp;
- }
-}
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
- * as indicated by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-
-package org.switchyard.deployment;
-
-import org.apache.log4j.Logger;
-import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.classloading.spi.version.Version;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-
-/**
- * Class loading deployer for SwitchYard apps.
- *
- * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly@gmail.com</a>
- */
-public class SwitchYardClassLoadingDeployer extends AbstractRealDeployer {
-
- private static Logger _logger = Logger.getLogger(SwitchYardClassLoadingDeployer.class);
-
- /**
- * Public default constructor.
- */
- public SwitchYardClassLoadingDeployer() {
- addInput(SwitchYardMetaData.class);
- addInput(ClassLoadingMetaData.class);
- addOutput(ClassLoadingMetaData.class);
- setStage(DeploymentStages.POST_PARSE);
- }
-
- @Override
- protected void internalDeploy(DeploymentUnit unit) throws DeploymentException {
- if (unit.getAttachment(SwitchYardMetaData.class) != null) {
- configureModuleClassloading(unit);
- }
- }
-
- private void configureModuleClassloading(DeploymentUnit unit) {
- ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class);
-
- if (classLoadingMetaData == null) {
- // By default, import/export nothing in/out of the module...
- classLoadingMetaData = new ClassLoadingMetaData();
- classLoadingMetaData.setName(unit.getName());
- classLoadingMetaData.setDomain(unit.getName());
- classLoadingMetaData.setImportAll(false);
- classLoadingMetaData.setVersion(Version.DEFAULT_VERSION);
-
- unit.addAttachment(ClassLoadingMetaData.class, classLoadingMetaData);
- }
- }
-}
Oops, something went wrong.

0 comments on commit 41d4042

Please sign in to comment.