Author: objectiser
Date: 2010-11-17 09:01:59 -0500 (Wed, 17 Nov 2010)
New Revision: 1120
Added:
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/JBossServiceDeployer.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/WebMetaDataFactory.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/ServerConfig.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/KernelAwareSPIFactory.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/KernelLocator.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/MBeanServerLocator.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ObjectNameFactory.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ServerConfigFactory.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ServerConfigImpl.java
Removed:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelAwareSPIFactory.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelLocator.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/MBeanServerLocator.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ObjectNameFactory.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigFactory.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebMetaDataFactory.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ServerConfig.java
Modified:
trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/SVGPlugin.java
trunk/distribution/src/main/release/db/jboss/jboss-beans.xml
trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEServiceEndpointReference.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
trunk/runtime/jbossesb-bpel-assembly/src/main/assembly/esb.xml
trunk/runtime/si/pom.xml
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/DeploymentBuilder.java
trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java
Log:
Moved more jboss server specific stuff to new package.
Modified:
trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/SVGPlugin.java
===================================================================
---
trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/SVGPlugin.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/SVGPlugin.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -29,8 +29,8 @@
import org.jboss.soa.bpel.bpel2svg.BPEL2SVGUtil;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
import org.jboss.soa.bpel.runtime.engine.ode.BPELEngineImpl;
-import org.jboss.soa.si.ServerConfig;
-import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
+import org.jboss.soa.si.server.ServerConfig;
+import org.jboss.soa.si.server.jboss.ServerConfigFactory;
import org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface;
import org.wso2.carbon.bpel.ui.bpel2svg.SVGInterface;
Modified: trunk/distribution/src/main/release/db/jboss/jboss-beans.xml
===================================================================
--- trunk/distribution/src/main/release/db/jboss/jboss-beans.xml 2010-11-17 11:51:14 UTC
(rev 1119)
+++ trunk/distribution/src/main/release/db/jboss/jboss-beans.xml 2010-11-17 14:01:59 UTC
(rev 1120)
@@ -24,7 +24,7 @@
Locate the single instance of the kernel
-->
<bean name="org.jboss.soa.bpel.runtime.util:service=KernelLocator"
- class="org.jboss.soa.bpel.runtime.integration.KernelLocator">
+ class="org.jboss.soa.si.server.jboss.KernelLocator">
<property name="kernel">
<inject bean="jboss.kernel:service=Kernel" />
</property>
@@ -34,7 +34,7 @@
ServerConfig
-->
<bean name="org.jboss.soa.bpel.runtime.util:service=ServerConfig"
- class="org.jboss.soa.bpel.runtime.integration.ServerConfigImpl">
+ class="org.jboss.soa.si.server.jboss.ServerConfigImpl">
<property name="mbeanServer"><inject bean="JMXKernel"
property="mbeanServer"/></property>
<property
name="webServiceHost">${jboss.bind.address}</property>
</bean>
Modified: trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml 2010-11-17
11:51:14 UTC (rev 1119)
+++ trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml 2010-11-17
14:01:59 UTC (rev 1120)
@@ -25,7 +25,7 @@
Locate the single instance of the kernel
-->
<bean name="org.jboss.soa.bpel.runtime.util:service=KernelLocator"
- class="org.jboss.soa.bpel.runtime.integration.KernelLocator">
+ class="org.jboss.soa.si.server.jboss.KernelLocator">
<property name="kernel">
<inject bean="jboss.kernel:service=Kernel" />
</property>
@@ -35,7 +35,7 @@
ServerConfig
-->
<bean name="org.jboss.soa.bpel.runtime.util:service=ServerConfig"
- class="org.jboss.soa.bpel.runtime.integration.ServerConfigImpl">
+ class="org.jboss.soa.si.server.jboss.ServerConfigImpl">
<property name="mbeanServer"><inject bean="JMXKernel"
property="mbeanServer"/></property>
<property
name="webServiceHost">${jboss.bind.address}</property>
<property name="clusterNodeName"><inject
bean="HAPartition" property="nodeName" /></property>
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -41,9 +41,9 @@
import org.apache.ode.utils.GUID;
import org.apache.ode.utils.Properties;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
-import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
import org.jboss.soa.bpel.runtime.ws.ODEMessageAdapter;
import org.jboss.soa.si.InvocationAdapter;
+import org.jboss.soa.si.server.jboss.ServerConfigFactory;
import org.w3c.dom.Element;
import javax.transaction.*;
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -21,9 +21,9 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.iapi.*;
import org.jboss.soa.bpel.runtime.engine.PartnerChannel;
-import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
import org.jboss.soa.bpel.runtime.ws.*;
import org.jboss.soa.si.EndpointMetaData;
+import org.jboss.soa.si.server.jboss.ServerConfigFactory;
import org.jboss.soa.si.ws.WSDLReference;
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelAwareSPIFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelAwareSPIFactory.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelAwareSPIFactory.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, 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.
- */
-package org.jboss.soa.bpel.runtime.integration;
-
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.kernel.spi.dependency.KernelController;
-
-/**
- * SPI factory delegating to kernel for bean lookups
- *
- * @author richard.opalka(a)jboss.com
- * @author Heiko.Braun(a)jboss.com
- */
-public class KernelAwareSPIFactory
-{
- @SuppressWarnings("unchecked")
- public <T> T getKernelProvidedSPI(String beanName, Class<T> spiArtifact)
- {
- KernelController controller = KernelLocator.getKernel().getController();
- ControllerContext ctx = controller.getInstalledContext(beanName);
- return (T)ctx.getTarget();
- }
-}
\ No newline at end of file
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelLocator.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelLocator.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelLocator.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, 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.
- */
-package org.jboss.soa.bpel.runtime.integration;
-
-//$Id$
-
-import org.jboss.kernel.Kernel;
-
-/**
- * Locate the single instance of the kernel
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 12-May-2006
- */
-public class KernelLocator
-{
- private static Kernel kernel;
-
- public static Kernel getKernel()
- {
- return KernelLocator.kernel;
- }
-
- public void setKernel(Kernel kernel)
- {
- KernelLocator.kernel = kernel;
- }
-}
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/MBeanServerLocator.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/MBeanServerLocator.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/MBeanServerLocator.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, 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.
- */
-package org.jboss.soa.bpel.runtime.integration;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import java.util.Iterator;
-
-/**
- * Locate the single instance of the MBeanServer
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 30-Jul-2007
- */
-public class MBeanServerLocator
-{
- private MBeanServer mbeanServer;
-
- public MBeanServer getMbeanServer()
- {
- // In jboss-4.2 the MBeanServer cannot be injected
- if (mbeanServer == null)
- {
- for (Iterator i = MBeanServerFactory.findMBeanServer(null).iterator();
i.hasNext();)
- {
- mbeanServer = (MBeanServer)i.next();
- break;
- }
- }
- return mbeanServer;
- }
-
- public void setMbeanServer(MBeanServer mbeanServer)
- {
- this.mbeanServer = mbeanServer;
- }
-}
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ObjectNameFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ObjectNameFactory.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ObjectNameFactory.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, 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.
- */
-package org.jboss.soa.bpel.runtime.integration;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import java.util.Hashtable;
-
-/**
- * A simple factory for creating safe object names.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ObjectNameFactory
-{
- public static ObjectName create(String name)
- {
- try
- {
- return new ObjectName(name);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + name + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, String key, String value)
- {
- try
- {
- return new ObjectName(domain, key, value);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + key +
"," + value + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, Hashtable table)
- {
- try
- {
- return new ObjectName(domain, table);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + table +
"; " + e);
- }
- }
-}
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigFactory.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigFactory.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, 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.
- */
-package org.jboss.soa.bpel.runtime.integration;
-
-import org.jboss.soa.si.ServerConfig;
-
-
-/**
- * Factory to container independent config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.com
- *
- * @since 08-May-2006
- */
-public class ServerConfigFactory
-{
- /** The default bean name */
- public static String BEAN_NAME =
"org.jboss.soa.bpel.runtime.util:service=ServerConfig";
-
- public static ServerConfig getServerConfig()
- {
- return new KernelAwareSPIFactory().getKernelProvidedSPI(
- BEAN_NAME, ServerConfig.class
- );
- }
-}
\ No newline at end of file
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -1,252 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, 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.
- */
-package org.jboss.soa.bpel.runtime.integration;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.utils.GUID;
-import org.jboss.soa.si.ServerConfig;
-
-import javax.management.AttributeNotFoundException;
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.io.File;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Set;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class ServerConfigImpl implements ServerConfig
-{
- protected final Log log = LogFactory.getLog(getClass());
-
- // The MBeanServer
- private MBeanServer mbeanServer;
-
- private final static String UNDEFINED_HOSTNAME = "undefined.host";
-
- // The webservice host name that will be used when updating the wsdl
- private String webServiceHost = UNDEFINED_HOSTNAME;
- // The webservice port that will be used when updating the wsdl
- private int webServicePort;
- // The webservice port that will be used when updating the wsdl
- private int webServiceSecurePort;
-
- private static String nonClusteredServerName=new GUID().toString();
-
- private String clusterNodeName;
-
- public ServerConfigImpl()
- {
- }
-
- public MBeanServer getMbeanServer()
- {
- return mbeanServer;
- }
-
- public void setMbeanServer(MBeanServer mbeanServer)
- {
- this.mbeanServer = mbeanServer;
- }
-
- public String getImplementationTitle()
- {
- return "jbossas-riftsaw";
- }
-
- public String getImplementationVersion()
- {
- return "5.x";
- }
-
- public File getServerTempDir()
- {
- try
- {
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File dir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
- return dir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getHomeDir()
- {
- try
- {
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File dir = (File)getMbeanServer().getAttribute(oname, "HomeDir");
- return dir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getServerDataDir()
- {
- try
- {
- ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File dir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
- return dir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public String getWebServiceHost()
- {
- return webServiceHost;
- }
-
- public void setWebServiceHost(String host) throws UnknownHostException
- {
- if (host == null || host.trim().length() == 0)
- {
- log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
- host = UNDEFINED_HOSTNAME;
- }
- if ("0.0.0.0".equals(host))
- {
- InetAddress localHost = InetAddress.getLocalHost();
- log.debug("Using local host: " + localHost.getHostName());
- host = localHost.getHostName();
- }
- this.webServiceHost = host;
- }
-
- public void setWebServicePort(int port)
- {
- this.webServicePort = port;
- }
-
- public void setWebServiceSecurePort(int port)
- {
- this.webServiceSecurePort = port;
- }
-
- public int getWebServicePort()
- {
- if (webServicePort <= 0)
- webServicePort = getConnectorPort("HTTP/1.1", false);
-
- int localPort = webServicePort;
- if (localPort <= 0)
- {
- // Do not initialize webServicePort with the default, the connector port may become
available later
- log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
- localPort = 8080;
- }
-
- return localPort;
- }
-
-
- public int getWebServiceSecurePort()
- {
- if (webServiceSecurePort <= 0)
- webServiceSecurePort = getConnectorPort("HTTP/1.1", true);
-
- int localPort = webServiceSecurePort;
- if (localPort <= 0)
- {
- // Do not initialize webServiceSecurePort with the default, the connector port may
become available later
- log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
- localPort = 8443;
- }
-
- return localPort;
- }
-
- private int getConnectorPort(final String protocol, final boolean secure)
- {
- int port = -1;
-
- try
- {
- ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
-
- Set connectorNames = getMbeanServer().queryNames(connectors, null);
- for (Object current : connectorNames)
- {
- ObjectName currentName = (ObjectName)current;
-
- try
- {
- int connectorPort = (Integer)getMbeanServer().getAttribute(currentName,
"port");
- boolean connectorSecure = (Boolean)getMbeanServer().getAttribute(currentName,
"secure");
- String connectorProtocol = (String)getMbeanServer().getAttribute(currentName,
"protocol");
-
-
- if (protocol.equals(connectorProtocol) && secure == connectorSecure)
- {
- if (port > -1)
- {
- log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
- }
- else
- {
- port = connectorPort;
- }
- }
- }
- catch (AttributeNotFoundException ignored)
- {
- }
- }
-
- return port;
- }
- catch (JMException e)
- {
- return -1;
- }
- }
-
- public String getClusterNodeName() {
- if (this.clusterNodeName == null || "".equals(this.clusterNodeName.trim()))
{
- return nonClusteredServerName;
- }
- return this.clusterNodeName;
- }
-
- public void setClusterNodeName(String clusterNodeName) {
- this.clusterNodeName = clusterNodeName;
- }
-
-
- public String getUddiNodeName() {
- return this.getWebServiceHost() + "-" + this.getWebServicePort();
- }
-
-}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -40,11 +40,12 @@
import org.jboss.soa.bpel.runtime.engine.ode.ExecutionEnvironment;
import org.jboss.soa.bpel.runtime.engine.ode.UDDIClientFactory;
import org.jboss.soa.bpel.runtime.engine.ode.UDDIRegistration;
-import org.jboss.soa.bpel.runtime.integration.KernelLocator;
-import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
import org.jboss.soa.si.EndpointMetaData;
-import org.jboss.soa.si.ServerConfig;
import org.jboss.soa.si.ServiceEndpointReference;
+import org.jboss.soa.si.deployer.jboss.JBossServiceDeployer;
+import org.jboss.soa.si.server.ServerConfig;
+import org.jboss.soa.si.server.jboss.KernelLocator;
+import org.jboss.soa.si.server.jboss.ServerConfigFactory;
import org.jboss.soa.si.ws.BaseWebServiceEndpoint;
import org.jboss.soa.si.ws.DeploymentBuilder;
import org.jboss.soa.si.ws.WSDLParser;
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others 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.jboss.soa.bpel.runtime.ws;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.deployers.spi.attachments.MutableAttachments;
-import org.jboss.deployers.structure.spi.ClassLoaderFactory;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
-import org.jboss.kernel.Kernel;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.soa.bpel.runtime.integration.KernelLocator;
-import org.jboss.soa.si.EndpointMetaData;
-import org.jboss.soa.si.ServiceEndpointReference;
-import org.jboss.soa.si.deployer.ServiceDeployer;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-
-public class JBossServiceDeployer implements ServiceDeployer {
-
- public ServiceEndpointReference deploy(EndpointMetaData metaData, Class<?>
providerImpl, URL serviceUrl,
- final ClassLoader classLoader, File warArchive) throws Exception {
- Deployment deployment = createVFSDeployment(warArchive);
-
- // Classloading
- ClassLoaderFactory clf = new DelegatingClassLoaderFactory(classLoader);
-
- // WebMetaData
- String[] webContext = deriveWebContextFromServiceUrl(serviceUrl);
-
- WebMetaDataFactory wmdFactory = new WebMetaDataFactory(
- metaData.getEndpointId(), webContext[0], webContext[1],
providerImpl.getName()
- );
-
- MutableAttachments mutableAttachments =
- (MutableAttachments)deployment.getPredeterminedManagedObjects();
-
- // Applies to in memory only. Not used with VFS underneath
- //mutableAttachments.addAttachment(StructureMetaData.class, new
StructureMetaDataImpl());
- mutableAttachments.addAttachment(ClassLoaderFactory.class, clf);
- mutableAttachments.addAttachment(JBossWebMetaData.class,
wmdFactory.createWebMetaData(classLoader));
- mutableAttachments.addAttachment(DeploymentUnitFilter.class, new
RiftsawWSDeploymentUnitFilter());
-
- getMainDeployer().deploy(deployment);
-
- ODEServiceEndpointReference ref = new ODEServiceEndpointReference(
- metaData.getEndpointId(), serviceUrl, deployment.getName()
- );
-
- ref.setArchiveLocation(warArchive.getAbsolutePath());
-
- return(ref);
- }
-
- public void undeploy(ServiceEndpointReference ref) throws Exception {
- getMainDeployer().undeploy(ref.getDeploymentName());
- }
-
- private String[] deriveWebContextFromServiceUrl(URL serviceUrl) {
- // metadata based on soapAddress
- String urlPathInfo = serviceUrl.getPath(); // has always leading slash
- urlPathInfo = urlPathInfo.substring(1, urlPathInfo.length());
-
- String actualWebContext;
- String actualUrlPattern;
- actualWebContext = urlPathInfo;
- actualUrlPattern = "/*";
-
- return new String[] {actualWebContext, actualUrlPattern};
- }
-
- private Deployment createVFSDeployment(File war) throws IOException {
- VirtualFile webAppVFS = VFS.getRoot(war.toURI().toURL());
- return VFSDeploymentFactory.getInstance().createVFSDeployment(webAppVFS);
- }
-
- private DeployerClient getMainDeployer() {
- Kernel mc = KernelLocator.getKernel();
- ControllerContext context =
mc.getController().getInstalledContext("MainDeployer");
- DeployerClient mainDeployer = (DeployerClient)context.getTarget();
- return mainDeployer;
- }
-
- public class DelegatingClassLoaderFactory implements ClassLoaderFactory {
- private ClassLoader delegate;
-
- public DelegatingClassLoaderFactory(final ClassLoader delegate) {
- this.delegate = delegate;
- }
-
- public ClassLoader createClassLoader(DeploymentUnit unit) throws Exception {
- return delegate;
- }
-
- public void removeClassLoader(DeploymentUnit unit) throws Exception {
- // cleanup?
- }
- }
-
- public class RiftsawWSDeploymentUnitFilter implements DeploymentUnitFilter {
- public boolean accepts(DeploymentUnit unit) {
- // When I am attached, it's always a BPEL deployment
- return false;
- }
- }
-
-}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEServiceEndpointReference.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEServiceEndpointReference.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEServiceEndpointReference.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -57,9 +57,13 @@
}
public static ODEServiceEndpointReference toODE(ServiceEndpointReference ref) {
- if (ref instanceof ODEServiceEndpointReference) {
+ if (ref == null) {
+ return(null);
+ } else if (ref instanceof ODEServiceEndpointReference) {
return((ODEServiceEndpointReference)ref);
+ } else {
+ return(new ODEServiceEndpointReference(ref.getEndpointId(),
+ ref.getServiceUrl(), ref.getDeploymentName()));
}
- return(null);
}
}
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebMetaDataFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebMetaDataFactory.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebMetaDataFactory.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, 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.
- */
-package org.jboss.soa.bpel.runtime.ws;
-
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossServletsMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.ServletMappingMetaData;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Creates an in-memory representation of web meta data.
- * Based on
http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_1_0_GA/webservices/sr...
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class WebMetaDataFactory
-{
- private String endpointId;
- private String servletClassName = null;
- private String webContext = null;
- private String urlPattern = null;
-
- public WebMetaDataFactory(String endpointId, String webContext, String urlPattern,
String servletClassName)
- {
- this.endpointId = endpointId;
- this.servletClassName = servletClassName;
- this.webContext = webContext;
- this.urlPattern = urlPattern;
- }
-
- public JBossWebMetaData createWebMetaData(ClassLoader loader)
- {
- JBossWebMetaData jbwmd = new JBossWebMetaData();
- createWebAppDescriptor(jbwmd);
- createJBossWebAppDescriptor(jbwmd);
- return jbwmd;
- }
-
- private void createWebAppDescriptor(JBossWebMetaData jbwmd)
- {
- /*
- <servlet>
- <servlet-name>
- <servlet-class>
- </servlet>
- */
- JBossServletsMetaData servlets = jbwmd.getServlets();
- JBossServletMetaData servlet = new JBossServletMetaData();
- servlet.setServletName("Endpoint-"+endpointId);
- servlet.setServletClass(servletClassName);
- servlets.add(servlet);
-
-
- /*
- <servlet-mapping>
- <servlet-name>
- <url-pattern>
- </servlet-mapping>
- */
- List<ServletMappingMetaData> servletMappings = jbwmd.getServletMappings();
- if (servletMappings == null)
- {
- servletMappings = new ArrayList<ServletMappingMetaData>();
- jbwmd.setServletMappings(servletMappings);
- }
- ServletMappingMetaData servletMapping = new ServletMappingMetaData();
- servletMapping.setServletName("Endpoint-"+endpointId);
- ArrayList<String> urlPatterns = new ArrayList<String>();
- urlPatterns.add(urlPattern);
- servletMapping.setUrlPatterns(urlPatterns);
- servletMappings.add(servletMapping);
-
- }
-
- private void createJBossWebAppDescriptor(JBossWebMetaData jbwmd)
- {
- /* Create a jboss-web
- <jboss-web>
- <security-domain>java:/jaas/cts</security-domain>
- <context-root>/ws/ejbN/</context-root>
- <virtual-host>some.domain.com</virtual-host>
- </jboss-web>
- */
-
- jbwmd.setContextRoot(webContext);
- }
-}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -52,8 +52,8 @@
import org.jboss.soa.bpel.runtime.engine.ode.ExecutionEnvironment;
import org.jboss.soa.bpel.runtime.engine.ode.UDDIClientFactory;
import org.jboss.soa.bpel.runtime.engine.ode.UDDIRegistration;
-import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
import org.jboss.soa.si.EndpointMetaData;
+import org.jboss.soa.si.server.jboss.ServerConfigFactory;
import org.jboss.soa.si.ws.DOMWriter;
import org.jboss.soa.si.ws.JavaUtils;
import org.jboss.soa.si.ws.SOAPMessageAdapter;
Modified: trunk/runtime/jbossesb-bpel-assembly/src/main/assembly/esb.xml
===================================================================
--- trunk/runtime/jbossesb-bpel-assembly/src/main/assembly/esb.xml 2010-11-17 11:51:14 UTC
(rev 1119)
+++ trunk/runtime/jbossesb-bpel-assembly/src/main/assembly/esb.xml 2010-11-17 14:01:59 UTC
(rev 1120)
@@ -41,6 +41,7 @@
<outputDirectory>/lib</outputDirectory>
<includes>
<include>org.jboss.soa.bpel.runtime:riftsaw-engine</include>
+ <include>org.jboss.soa:si</include>
<include>org.jboss.soa.bpel.dependencies.esb:jbossesb-rosetta</include>
<include>org.jboss.soa.bpel:riftsaw-agents</include>
<include>org.jboss.soa.bpel:riftsaw-bpel-runtime</include>
Modified: trunk/runtime/si/pom.xml
===================================================================
--- trunk/runtime/si/pom.xml 2010-11-17 11:51:14 UTC (rev 1119)
+++ trunk/runtime/si/pom.xml 2010-11-17 14:01:59 UTC (rev 1120)
@@ -25,65 +25,7 @@
<artifactId>commons-logging</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-bpel-store</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-bpel-dao</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-bpel-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-utils</artifactId>
- </dependency>
- <!-- ODE2 dependencies
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-il-common</artifactId>
- <version>${riftsaw.engine.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-engine</artifactId>
- <version>${riftsaw.engine.version}</version>
- </dependency>
- -->
-
- <!-- ODE1.3.3 dependencies -->
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-bpel-runtime</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-bpel-epr</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-agents</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-scheduler-simple</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel.runtime</groupId>
- <artifactId>deployer</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
<!-- WS support -->
<dependency>
<groupId>javassist</groupId>
@@ -114,30 +56,6 @@
<type>pom</type>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-bpel-compiler</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-core</artifactId>
- <version>${cxf.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-ws-security</artifactId>
- <version>${cxf.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- for H2Database -->
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
Deleted: trunk/runtime/si/src/main/java/org/jboss/soa/si/ServerConfig.java
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/ServerConfig.java 2010-11-17 11:51:14
UTC (rev 1119)
+++ trunk/runtime/si/src/main/java/org/jboss/soa/si/ServerConfig.java 2010-11-17 14:01:59
UTC (rev 1120)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, 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.
- */
-package org.jboss.soa.si;
-
-import java.io.File;
-
-/**
- * Interface to container independent config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public interface ServerConfig
-{
- String getImplementationTitle();
-
- String getImplementationVersion();
-
- File getServerTempDir();
-
- File getServerDataDir();
-
- String getWebServiceHost();
-
- int getWebServicePort();
-
- int getWebServiceSecurePort();
-
- String getClusterNodeName();
-
- String getUddiNodeName();
-
-}
\ No newline at end of file
Copied:
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/JBossServiceDeployer.java
(from rev 1119,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/JBossServiceDeployer.java)
===================================================================
---
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/JBossServiceDeployer.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/JBossServiceDeployer.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others 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.jboss.soa.si.deployer.jboss;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.attachments.MutableAttachments;
+import org.jboss.deployers.structure.spi.ClassLoaderFactory;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.DeploymentUnitFilter;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.kernel.Kernel;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.soa.si.server.jboss.KernelLocator;
+import org.jboss.soa.si.EndpointMetaData;
+import org.jboss.soa.si.ServiceEndpointReference;
+import org.jboss.soa.si.deployer.ServiceDeployer;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+public class JBossServiceDeployer implements ServiceDeployer {
+
+ public ServiceEndpointReference deploy(EndpointMetaData metaData, Class<?>
providerImpl, URL serviceUrl,
+ final ClassLoader classLoader, File warArchive) throws Exception {
+ Deployment deployment = createVFSDeployment(warArchive);
+
+ // Classloading
+ ClassLoaderFactory clf = new DelegatingClassLoaderFactory(classLoader);
+
+ // WebMetaData
+ String[] webContext = deriveWebContextFromServiceUrl(serviceUrl);
+
+ WebMetaDataFactory wmdFactory = new WebMetaDataFactory(
+ metaData.getEndpointId(), webContext[0], webContext[1],
providerImpl.getName()
+ );
+
+ MutableAttachments mutableAttachments =
+ (MutableAttachments)deployment.getPredeterminedManagedObjects();
+
+ // Applies to in memory only. Not used with VFS underneath
+ //mutableAttachments.addAttachment(StructureMetaData.class, new
StructureMetaDataImpl());
+ mutableAttachments.addAttachment(ClassLoaderFactory.class, clf);
+ mutableAttachments.addAttachment(JBossWebMetaData.class,
wmdFactory.createWebMetaData(classLoader));
+ mutableAttachments.addAttachment(DeploymentUnitFilter.class, new
RiftsawWSDeploymentUnitFilter());
+
+ getMainDeployer().deploy(deployment);
+
+ ServiceEndpointReference ref = new ServiceEndpointReference(
+ metaData.getEndpointId(), serviceUrl, deployment.getName()
+ );
+
+ ref.setArchiveLocation(warArchive.getAbsolutePath());
+
+ return(ref);
+ }
+
+ public void undeploy(ServiceEndpointReference ref) throws Exception {
+ getMainDeployer().undeploy(ref.getDeploymentName());
+ }
+
+ private String[] deriveWebContextFromServiceUrl(URL serviceUrl) {
+ // metadata based on soapAddress
+ String urlPathInfo = serviceUrl.getPath(); // has always leading slash
+ urlPathInfo = urlPathInfo.substring(1, urlPathInfo.length());
+
+ String actualWebContext;
+ String actualUrlPattern;
+ actualWebContext = urlPathInfo;
+ actualUrlPattern = "/*";
+
+ return new String[] {actualWebContext, actualUrlPattern};
+ }
+
+ private Deployment createVFSDeployment(File war) throws IOException {
+ VirtualFile webAppVFS = VFS.getRoot(war.toURI().toURL());
+ return VFSDeploymentFactory.getInstance().createVFSDeployment(webAppVFS);
+ }
+
+ private DeployerClient getMainDeployer() {
+ Kernel mc = KernelLocator.getKernel();
+ ControllerContext context =
mc.getController().getInstalledContext("MainDeployer");
+ DeployerClient mainDeployer = (DeployerClient)context.getTarget();
+ return mainDeployer;
+ }
+
+ public class DelegatingClassLoaderFactory implements ClassLoaderFactory {
+ private ClassLoader delegate;
+
+ public DelegatingClassLoaderFactory(final ClassLoader delegate) {
+ this.delegate = delegate;
+ }
+
+ public ClassLoader createClassLoader(DeploymentUnit unit) throws Exception {
+ return delegate;
+ }
+
+ public void removeClassLoader(DeploymentUnit unit) throws Exception {
+ // cleanup?
+ }
+ }
+
+ public class RiftsawWSDeploymentUnitFilter implements DeploymentUnitFilter {
+ public boolean accepts(DeploymentUnit unit) {
+ // When I am attached, it's always a BPEL deployment
+ return false;
+ }
+ }
+
+}
Copied:
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/WebMetaDataFactory.java
(from rev 1113,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebMetaDataFactory.java)
===================================================================
---
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/WebMetaDataFactory.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/deployer/jboss/WebMetaDataFactory.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.si.deployer.jboss;
+
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Creates an in-memory representation of web meta data.
+ * Based on
http://anonsvn.jboss.org/repos/jbossas/tags/JBoss_5_1_0_GA/webservices/sr...
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class WebMetaDataFactory
+{
+ private String endpointId;
+ private String servletClassName = null;
+ private String webContext = null;
+ private String urlPattern = null;
+
+ public WebMetaDataFactory(String endpointId, String webContext, String urlPattern,
String servletClassName)
+ {
+ this.endpointId = endpointId;
+ this.servletClassName = servletClassName;
+ this.webContext = webContext;
+ this.urlPattern = urlPattern;
+ }
+
+ public JBossWebMetaData createWebMetaData(ClassLoader loader)
+ {
+ JBossWebMetaData jbwmd = new JBossWebMetaData();
+ createWebAppDescriptor(jbwmd);
+ createJBossWebAppDescriptor(jbwmd);
+ return jbwmd;
+ }
+
+ private void createWebAppDescriptor(JBossWebMetaData jbwmd)
+ {
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ JBossServletsMetaData servlets = jbwmd.getServlets();
+ JBossServletMetaData servlet = new JBossServletMetaData();
+ servlet.setServletName("Endpoint-"+endpointId);
+ servlet.setServletClass(servletClassName);
+ servlets.add(servlet);
+
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ List<ServletMappingMetaData> servletMappings = jbwmd.getServletMappings();
+ if (servletMappings == null)
+ {
+ servletMappings = new ArrayList<ServletMappingMetaData>();
+ jbwmd.setServletMappings(servletMappings);
+ }
+ ServletMappingMetaData servletMapping = new ServletMappingMetaData();
+ servletMapping.setServletName("Endpoint-"+endpointId);
+ ArrayList<String> urlPatterns = new ArrayList<String>();
+ urlPatterns.add(urlPattern);
+ servletMapping.setUrlPatterns(urlPatterns);
+ servletMappings.add(servletMapping);
+
+ }
+
+ private void createJBossWebAppDescriptor(JBossWebMetaData jbwmd)
+ {
+ /* Create a jboss-web
+ <jboss-web>
+ <security-domain>java:/jaas/cts</security-domain>
+ <context-root>/ws/ejbN/</context-root>
+ <virtual-host>some.domain.com</virtual-host>
+ </jboss-web>
+ */
+
+ jbwmd.setContextRoot(webContext);
+ }
+}
Copied: trunk/runtime/si/src/main/java/org/jboss/soa/si/server/ServerConfig.java (from rev
1118, trunk/runtime/si/src/main/java/org/jboss/soa/si/ServerConfig.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/server/ServerConfig.java
(rev 0)
+++ trunk/runtime/si/src/main/java/org/jboss/soa/si/server/ServerConfig.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.si.server;
+
+import java.io.File;
+
+/**
+ * Interface to container independent config
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public interface ServerConfig
+{
+ String getImplementationTitle();
+
+ String getImplementationVersion();
+
+ File getServerTempDir();
+
+ File getServerDataDir();
+
+ String getWebServiceHost();
+
+ int getWebServicePort();
+
+ int getWebServiceSecurePort();
+
+ String getClusterNodeName();
+
+ String getUddiNodeName();
+
+}
\ No newline at end of file
Copied:
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/KernelAwareSPIFactory.java
(from rev 1113,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelAwareSPIFactory.java)
===================================================================
---
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/KernelAwareSPIFactory.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/KernelAwareSPIFactory.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.si.server.jboss;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.spi.dependency.KernelController;
+
+/**
+ * SPI factory delegating to kernel for bean lookups
+ *
+ * @author richard.opalka(a)jboss.com
+ * @author Heiko.Braun(a)jboss.com
+ */
+public class KernelAwareSPIFactory
+{
+ @SuppressWarnings("unchecked")
+ public <T> T getKernelProvidedSPI(String beanName, Class<T> spiArtifact)
+ {
+ KernelController controller = KernelLocator.getKernel().getController();
+ ControllerContext ctx = controller.getInstalledContext(beanName);
+ return (T)ctx.getTarget();
+ }
+}
\ No newline at end of file
Copied: trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/KernelLocator.java
(from rev 1113,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/KernelLocator.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/KernelLocator.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/KernelLocator.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.si.server.jboss;
+
+//$Id$
+
+import org.jboss.kernel.Kernel;
+
+/**
+ * Locate the single instance of the kernel
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-May-2006
+ */
+public class KernelLocator
+{
+ private static Kernel kernel;
+
+ public static Kernel getKernel()
+ {
+ return KernelLocator.kernel;
+ }
+
+ public void setKernel(Kernel kernel)
+ {
+ KernelLocator.kernel = kernel;
+ }
+}
Copied:
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/MBeanServerLocator.java (from
rev 1113,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/MBeanServerLocator.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/MBeanServerLocator.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/MBeanServerLocator.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.si.server.jboss;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import java.util.Iterator;
+
+/**
+ * Locate the single instance of the MBeanServer
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 30-Jul-2007
+ */
+public class MBeanServerLocator
+{
+ private MBeanServer mbeanServer;
+
+ public MBeanServer getMbeanServer()
+ {
+ // In jboss-4.2 the MBeanServer cannot be injected
+ if (mbeanServer == null)
+ {
+ for (Iterator i = MBeanServerFactory.findMBeanServer(null).iterator();
i.hasNext();)
+ {
+ mbeanServer = (MBeanServer)i.next();
+ break;
+ }
+ }
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+}
Copied:
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ObjectNameFactory.java (from
rev 1113,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ObjectNameFactory.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ObjectNameFactory.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ObjectNameFactory.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.si.server.jboss;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import java.util.Hashtable;
+
+/**
+ * A simple factory for creating safe object names.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class ObjectNameFactory
+{
+ public static ObjectName create(String name)
+ {
+ try
+ {
+ return new ObjectName(name);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + name + "; " + e);
+ }
+ }
+
+ public static ObjectName create(String domain, String key, String value)
+ {
+ try
+ {
+ return new ObjectName(domain, key, value);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + domain + "," + key +
"," + value + "; " + e);
+ }
+ }
+
+ public static ObjectName create(String domain, Hashtable table)
+ {
+ try
+ {
+ return new ObjectName(domain, table);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + domain + "," + table +
"; " + e);
+ }
+ }
+}
Copied:
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ServerConfigFactory.java
(from rev 1118,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigFactory.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ServerConfigFactory.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ServerConfigFactory.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.si.server.jboss;
+
+import org.jboss.soa.si.server.ServerConfig;
+
+
+/**
+ * Factory to container independent config
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.com
+ *
+ * @since 08-May-2006
+ */
+public class ServerConfigFactory
+{
+ /** The default bean name */
+ public static String BEAN_NAME =
"org.jboss.soa.bpel.runtime.util:service=ServerConfig";
+
+ public static ServerConfig getServerConfig()
+ {
+ return new KernelAwareSPIFactory().getKernelProvidedSPI(
+ BEAN_NAME, ServerConfig.class
+ );
+ }
+}
\ No newline at end of file
Copied: trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ServerConfigImpl.java
(from rev 1118,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/integration/ServerConfigImpl.java)
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ServerConfigImpl.java
(rev 0)
+++
trunk/runtime/si/src/main/java/org/jboss/soa/si/server/jboss/ServerConfigImpl.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -0,0 +1,252 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.
+ */
+package org.jboss.soa.si.server.jboss;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.soa.si.server.ServerConfig;
+import org.jboss.util.id.GUID;
+
+import javax.management.AttributeNotFoundException;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import java.io.File;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Set;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ServerConfigImpl implements ServerConfig
+{
+ protected final Log log = LogFactory.getLog(getClass());
+
+ // The MBeanServer
+ private MBeanServer mbeanServer;
+
+ private final static String UNDEFINED_HOSTNAME = "undefined.host";
+
+ // The webservice host name that will be used when updating the wsdl
+ private String webServiceHost = UNDEFINED_HOSTNAME;
+ // The webservice port that will be used when updating the wsdl
+ private int webServicePort;
+ // The webservice port that will be used when updating the wsdl
+ private int webServiceSecurePort;
+
+ private static String nonClusteredServerName=new GUID().toString();
+
+ private String clusterNodeName;
+
+ public ServerConfigImpl()
+ {
+ }
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ public String getImplementationTitle()
+ {
+ return "jbossas-riftsaw";
+ }
+
+ public String getImplementationVersion()
+ {
+ return "5.x";
+ }
+
+ public File getServerTempDir()
+ {
+ try
+ {
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File dir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
+ return dir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getHomeDir()
+ {
+ try
+ {
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File dir = (File)getMbeanServer().getAttribute(oname, "HomeDir");
+ return dir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getServerDataDir()
+ {
+ try
+ {
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File dir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
+ return dir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public String getWebServiceHost()
+ {
+ return webServiceHost;
+ }
+
+ public void setWebServiceHost(String host) throws UnknownHostException
+ {
+ if (host == null || host.trim().length() == 0)
+ {
+ log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
+ host = UNDEFINED_HOSTNAME;
+ }
+ if ("0.0.0.0".equals(host))
+ {
+ InetAddress localHost = InetAddress.getLocalHost();
+ log.debug("Using local host: " + localHost.getHostName());
+ host = localHost.getHostName();
+ }
+ this.webServiceHost = host;
+ }
+
+ public void setWebServicePort(int port)
+ {
+ this.webServicePort = port;
+ }
+
+ public void setWebServiceSecurePort(int port)
+ {
+ this.webServiceSecurePort = port;
+ }
+
+ public int getWebServicePort()
+ {
+ if (webServicePort <= 0)
+ webServicePort = getConnectorPort("HTTP/1.1", false);
+
+ int localPort = webServicePort;
+ if (localPort <= 0)
+ {
+ // Do not initialize webServicePort with the default, the connector port may become
available later
+ log.warn("Unable to calculate 'WebServicePort', using default
'8080'");
+ localPort = 8080;
+ }
+
+ return localPort;
+ }
+
+
+ public int getWebServiceSecurePort()
+ {
+ if (webServiceSecurePort <= 0)
+ webServiceSecurePort = getConnectorPort("HTTP/1.1", true);
+
+ int localPort = webServiceSecurePort;
+ if (localPort <= 0)
+ {
+ // Do not initialize webServiceSecurePort with the default, the connector port may
become available later
+ log.warn("Unable to calculate 'WebServiceSecurePort', using default
'8443'");
+ localPort = 8443;
+ }
+
+ return localPort;
+ }
+
+ private int getConnectorPort(final String protocol, final boolean secure)
+ {
+ int port = -1;
+
+ try
+ {
+ ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
+
+ Set connectorNames = getMbeanServer().queryNames(connectors, null);
+ for (Object current : connectorNames)
+ {
+ ObjectName currentName = (ObjectName)current;
+
+ try
+ {
+ int connectorPort = (Integer)getMbeanServer().getAttribute(currentName,
"port");
+ boolean connectorSecure = (Boolean)getMbeanServer().getAttribute(currentName,
"secure");
+ String connectorProtocol = (String)getMbeanServer().getAttribute(currentName,
"protocol");
+
+
+ if (protocol.equals(connectorProtocol) && secure == connectorSecure)
+ {
+ if (port > -1)
+ {
+ log.warn("Found multiple connectors for protocol='" +
protocol + "' and secure='" + secure + "', using first port
found '" + port + "'");
+ }
+ else
+ {
+ port = connectorPort;
+ }
+ }
+ }
+ catch (AttributeNotFoundException ignored)
+ {
+ }
+ }
+
+ return port;
+ }
+ catch (JMException e)
+ {
+ return -1;
+ }
+ }
+
+ public String getClusterNodeName() {
+ if (this.clusterNodeName == null || "".equals(this.clusterNodeName.trim()))
{
+ return nonClusteredServerName;
+ }
+ return this.clusterNodeName;
+ }
+
+ public void setClusterNodeName(String clusterNodeName) {
+ this.clusterNodeName = clusterNodeName;
+ }
+
+
+ public String getUddiNodeName() {
+ return this.getWebServiceHost() + "-" + this.getWebServicePort();
+ }
+
+}
Modified: trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/DeploymentBuilder.java
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/DeploymentBuilder.java 2010-11-17
11:51:14 UTC (rev 1119)
+++ trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/DeploymentBuilder.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -21,7 +21,7 @@
*/
package org.jboss.soa.si.ws;
-import org.jboss.soa.si.ServerConfig;
+import org.jboss.soa.si.server.ServerConfig;
import java.io.*;
Modified: trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java
===================================================================
--- trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java 2010-11-17
11:51:14 UTC (rev 1119)
+++ trunk/runtime/si/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -23,7 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
+//import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
import org.jboss.soa.si.MessageAdapter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -661,7 +661,7 @@
* Initialize the document-builder factory.
*/
private static void initDocumentBuilderFactory() {
- DocumentBuilderFactory f = new DocumentBuilderFactoryImpl();
+ DocumentBuilderFactory f =
javax.xml.parsers.DocumentBuilderFactory.newInstance();//new
DocumentBuilderFactoryImpl();
f.setNamespaceAware(true);
__documentBuilderFactory = f;
}
Modified:
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java
===================================================================
---
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java 2010-11-17
11:51:14 UTC (rev 1119)
+++
trunk/runtime/uddi/src/main/java/org/jboss/soa/bpel/uddi/UDDIRegistrationImpl.java 2010-11-17
14:01:59 UTC (rev 1120)
@@ -45,8 +45,8 @@
import org.apache.juddi.v3.client.config.UDDIClientContainer;
import org.apache.juddi.v3.client.transport.TransportException;
import org.jboss.soa.bpel.runtime.engine.ode.UDDIRegistration;
-import org.jboss.soa.bpel.runtime.integration.ServerConfigFactory;
import org.jboss.soa.bpel.runtime.ws.WebServiceClient;
+import org.jboss.soa.si.server.jboss.ServerConfigFactory;
import org.jboss.soa.si.ws.WSDLReference;
import org.uddi.api_v3.AccessPoint;
import org.uddi.api_v3.BindingTemplate;