JBossWS SVN: r13555 - in common/trunk/src/main/java/org/jboss/wsf: framework and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 11:08:33 -0500 (Tue, 11 Jan 2011)
New Revision: 13555
Added:
common/trunk/src/main/java/org/jboss/wsf/framework/
common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleContextRootDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeployment.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandlerFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectInstaller.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/JAXBIntroDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/WebservicesDescriptorParserImpl.java
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/
common/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/WebservicesDescriptorProcessorImpl.java
common/trunk/src/main/java/org/jboss/wsf/framework/invocation/
common/trunk/src/main/java/org/jboss/wsf/framework/invocation/DefaultResourceInjectorFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java
common/trunk/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/
common/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointMetricsFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistry.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultJMSEndpointResolver.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/EndpointMetricsImpl.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
common/trunk/src/main/java/org/jboss/wsf/framework/security/
common/trunk/src/main/java/org/jboss/wsf/framework/security/DefaultSecurityAdapterFactory.java
common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/
common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandler.java
common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandlerFactory.java
Log:
refactoring framework sources to common
Added: common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,117 @@
+/*
+ * 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.wsf.framework;
+
+import org.jboss.wsf.framework.deployment.DefaultDeploymentAspectManagerFactory;
+import org.jboss.wsf.framework.deployment.DefaultDeploymentModelFactory;
+import org.jboss.wsf.framework.deployment.DefaultLifecycleHandlerFactory;
+import org.jboss.wsf.framework.invocation.DefaultResourceInjectorFactory;
+import org.jboss.wsf.framework.management.DefaultEndpointMetricsFactory;
+import org.jboss.wsf.framework.management.DefaultEndpointRegistryFactory;
+import org.jboss.wsf.framework.management.DefaultJMSEndpointResolver;
+import org.jboss.wsf.framework.security.DefaultSecurityAdapterFactory;
+import org.jboss.wsf.framework.serviceref.DefaultServiceRefHandlerFactory;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
+import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+import org.jboss.wsf.spi.management.EndpointMetricsFactory;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.jboss.wsf.spi.management.JMSEndpointResolver;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
+import org.jboss.wsf.spi.util.ServiceLoader;
+
+/**
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+class DefaultSPIProvider extends SPIProvider
+{
+
+ /**
+ * Gets the specified SPI.
+ */
+ public <T> T getSPI(Class<T> spiType)
+ {
+ T returnType = null;
+
+ // SPIs provided by framework, defaults can be overridden
+ if (DeploymentAspectManagerFactory.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultDeploymentAspectManagerFactory.class);
+ }
+ if (DeploymentModelFactory.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultDeploymentModelFactory.class);
+ }
+ else if (EndpointMetricsFactory.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultEndpointMetricsFactory.class);
+ }
+ else if (LifecycleHandlerFactory.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultLifecycleHandlerFactory.class);
+ }
+ else if (ResourceInjectorFactory.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultResourceInjectorFactory.class);
+ }
+ else if (ServiceRefHandlerFactory.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultServiceRefHandlerFactory.class);
+ }
+ else if (SecurityAdaptorFactory.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultSecurityAdapterFactory.class);
+ }
+ else if (EndpointRegistryFactory.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultEndpointRegistryFactory.class);
+ }
+ else if (JMSEndpointResolver.class.equals(spiType))
+ {
+ returnType = loadService(spiType, DefaultJMSEndpointResolver.class);
+ }
+ else
+ {
+ // SPI provided by either container or stack integration that has no default implementation
+ returnType = (T)loadService(spiType, null);
+ }
+
+ if (returnType == null)
+ throw new WSFException("Failed to provide SPI '" + spiType + "'");
+
+ return returnType;
+ }
+
+ // Load SPI implementation through ServiceLoader
+ @SuppressWarnings("unchecked")
+ private <T> T loadService(Class<T> spiType, Class<?> defaultImpl)
+ {
+ final String defaultImplName = defaultImpl != null ? defaultImpl.getName() : null;
+ return (T)ServiceLoader.loadService(spiType.getName(), defaultImplName);
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,48 @@
+/*
+ * 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.wsf.framework;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+
+/**
+ * TODO: javadoc
+ *
+ * @author <a href="mailto:hbraun@redhat.com">Heiko Braun</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class DefaultSPIProviderResolver extends SPIProviderResolver
+{
+
+ private static final SPIProvider SPI_PROVIDER = new DefaultSPIProvider();
+
+ public DefaultSPIProviderResolver()
+ {
+ super();
+ }
+
+ public SPIProvider getProvider()
+ {
+ return DefaultSPIProviderResolver.SPI_PROVIDER;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,284 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.jboss.wsf.common.injection.PreDestroyHolder;
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.LifecycleHandler;
+import org.jboss.wsf.spi.deployment.Service;
+import org.jboss.wsf.spi.deployment.WSFDeploymentException;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * A general abstract JAXWS endpoint.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class AbstractDefaultEndpoint extends AbstractExtensible
+{
+ protected Service service;
+ protected ObjectName name;
+ protected String shortName;
+ protected String urlPattern;
+ protected String targetBean;
+ protected Class<?> targetBeanClass;
+ protected EndpointState state;
+ protected RequestHandler requestHandler;
+ protected InvocationHandler invocationHandler;
+ protected LifecycleHandler lifecycleHandler;
+ protected EndpointMetrics metrics;
+ protected String address;
+ protected List<RecordProcessor> recordProcessors = new Vector<RecordProcessor>();
+
+ AbstractDefaultEndpoint(String targetBean)
+ {
+ this.targetBean = targetBean;
+ this.state = EndpointState.UNDEFINED;
+ }
+
+ public Service getService()
+ {
+ return service;
+ }
+
+ public void setService(Service service)
+ {
+ assertEndpointSetterAccess();
+ this.service = service;
+ }
+
+ public String getTargetBeanName()
+ {
+ return targetBean;
+ }
+
+ public void setTargetBeanName(String targetBean)
+ {
+ assertEndpointSetterAccess();
+ this.targetBean = targetBean;
+ }
+
+ public synchronized Class<?> getTargetBeanClass()
+ {
+ if (targetBean == null)
+ throw new IllegalStateException("Target bean not set");
+ if (targetBeanClass != null)
+ return targetBeanClass;
+
+ ClassLoader classLoader = service.getDeployment().getRuntimeClassLoader();
+
+ try
+ {
+ targetBeanClass = classLoader.loadClass(targetBean);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ throw new WSFDeploymentException(ex);
+ }
+
+ return targetBeanClass;
+ }
+
+ public ObjectName getName()
+ {
+ if(null==name)
+ {
+ // build implicit name
+ try
+ {
+ name = new ObjectName(
+ Endpoint.SEPID_DOMAIN,
+ Endpoint.SEPID_PROPERTY_ENDPOINT, targetBean
+ );
+
+ } catch (MalformedObjectNameException e)
+ {
+ //
+ }
+ }
+
+ return name;
+ }
+
+ public void setName(ObjectName name)
+ {
+ assertEndpointSetterAccess();
+ this.name = name;
+ }
+
+ public String getShortName()
+ {
+ return shortName;
+ }
+
+ public void setShortName(String shortName)
+ {
+ assertEndpointSetterAccess();
+ this.shortName = shortName;
+ }
+
+
+ public EndpointState getState()
+ {
+ return state;
+ }
+
+ public void setState(EndpointState state)
+ {
+ this.state = state;
+ }
+
+ public RequestHandler getRequestHandler()
+ {
+ return requestHandler;
+ }
+
+ public void setRequestHandler(RequestHandler handler)
+ {
+ assertEndpointSetterAccess();
+ this.requestHandler = handler;
+ }
+
+ public LifecycleHandler getLifecycleHandler()
+ {
+ return lifecycleHandler;
+ }
+
+ public void setLifecycleHandler(LifecycleHandler handler)
+ {
+ assertEndpointSetterAccess();
+ this.lifecycleHandler = handler;
+ }
+
+ public InvocationHandler getInvocationHandler()
+ {
+ return invocationHandler;
+ }
+
+ public void setInvocationHandler(InvocationHandler handler)
+ {
+ assertEndpointSetterAccess();
+ this.invocationHandler = handler;
+ }
+
+ @Override
+ public <T> T addAttachment(Class<T> clazz, Object obj)
+ {
+ boolean isPreDestroyHolderClass = clazz.equals(PreDestroyHolder.class); // JBWS-2268 hack
+ boolean isObjectClass = clazz.equals(Object.class); // JBWS-2486 hack
+
+ if (!isPreDestroyHolderClass && !isObjectClass)
+ {
+ assertEndpointSetterAccess();
+ }
+ return super.addAttachment(clazz, obj);
+ }
+
+ @Override
+ public <T> T removeAttachment(Class<T> key)
+ {
+ boolean isPreDestroyHolderClass = key.equals(PreDestroyHolder.class); // JBWS-2268 hack
+ boolean isObjectClass = key.equals(Object.class); // JBWS-2486 hack
+
+ if (!isPreDestroyHolderClass && !isObjectClass)
+ {
+ assertEndpointSetterAccess();
+ }
+ return super.removeAttachment(key);
+ }
+
+ public void removeProperty(String key)
+ {
+ assertEndpointSetterAccess();
+ super.removeProperty(key);
+ }
+
+ public void setProperty(String key, Object value)
+ {
+ assertEndpointSetterAccess();
+ super.setProperty(key, value);
+ }
+
+ protected void assertEndpointSetterAccess()
+ {
+ if (state == EndpointState.STARTED)
+ throw new IllegalStateException("Cannot modify endpoint properties in state: " + state);
+ }
+
+ public List<RecordProcessor> getRecordProcessors()
+ {
+ return recordProcessors;
+ }
+
+ public void setRecordProcessors(List<RecordProcessor> recordProcessors)
+ {
+ this.recordProcessors = new Vector<RecordProcessor>(recordProcessors);
+ }
+
+ public void processRecord(Record record)
+ {
+ for (RecordProcessor processor : recordProcessors)
+ {
+ if (processor.isRecording())
+ {
+ boolean match = true;
+ if (processor.getFilters() != null)
+ {
+ for (Iterator<RecordFilter> it = processor.getFilters().iterator(); it.hasNext() && match;)
+ {
+ match = it.next().match(record);
+ }
+ }
+ if (match)
+ {
+ processor.processRecord(record);
+ }
+ }
+ }
+ }
+
+ public String getAddress()
+ {
+ return this.address;
+ }
+
+ public void setAddress(String address)
+ {
+ this.address = address;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentImpl.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,103 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.ResourceResolver;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+
+/**
+ * A general web service deployment that is based on an archive.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class ArchiveDeploymentImpl extends DefaultDeployment implements ArchiveDeployment
+{
+ // The optional parent
+ private ArchiveDeployment parent;
+ // The root file for this deployment
+ private UnifiedVirtualFile rootFile;
+
+ private static Logger log = Logger.getLogger(ArchiveDeploymentImpl.class);
+
+ private List<UnifiedVirtualFile> metadataFiles;
+
+ ArchiveDeploymentImpl(String simpleName, ClassLoader classLoader)
+ {
+ super(simpleName, classLoader);
+ }
+
+ public ArchiveDeployment getParent()
+ {
+ return parent;
+ }
+
+ public void setParent(ArchiveDeployment parent)
+ {
+ this.parent = parent;
+ }
+
+ public UnifiedVirtualFile getRootFile()
+ {
+ return rootFile;
+ }
+
+ public void setRootFile(UnifiedVirtualFile rootFile)
+ {
+ this.rootFile = rootFile;
+ }
+
+ public String getCanonicalName()
+ {
+ String name = getSimpleName();
+ if (getParent() != null)
+ name = getParent().getCanonicalName() + "/" + name;
+ return name;
+ }
+
+ @Deprecated
+ public URL getMetaDataFileURL(String resourcePath) throws IOException
+ {
+ return getResourceResolver().resolve(resourcePath);
+ }
+
+ public List<UnifiedVirtualFile> getMetadataFiles()
+ {
+ return metadataFiles;
+ }
+
+ public void setMetadataFiles(List<UnifiedVirtualFile> metadataFiles)
+ {
+ this.metadataFiles = metadataFiles;
+ }
+
+ public ResourceResolver getResourceResolver()
+ {
+ return new ResourceResolverImpl(rootFile, metadataFiles);
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,63 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Service;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+/**
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 26-Jul-2007
+ */
+public class ArchiveDeploymentModelFactory extends DeploymentModelFactory
+{
+ public Deployment newDeployment(String simpleName, ClassLoader initialLoader)
+ {
+ return new ArchiveDeploymentImpl(simpleName, initialLoader);
+ }
+
+ public Service newService()
+ {
+ return new DefaultService();
+ }
+
+ @Deprecated
+ /**
+ * Use #newHttpEndpoint(String) instead
+ */
+ public Endpoint newEndpoint(String targetBean)
+ {
+ return this.newHttpEndpoint(targetBean);
+ }
+
+ public Endpoint newHttpEndpoint(String targetBean)
+ {
+ return new DefaultHttpEndpoint(targetBean);
+ }
+
+ public Endpoint newJMSEndpoint(String targetBean)
+ {
+ return new DefaultJMSEndpoint(targetBean);
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleContextRootDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleContextRootDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleContextRootDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,81 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.StringTokenizer;
+
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+
+/**
+ * A deployer that assigns the context root to the service.
+ *
+ * If there is no explicit <context-root>, this deployer uses
+ * the first token from the <port-component-uri> element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class BackwardCompatibleContextRootDeploymentAspect extends ContextRootDeploymentAspect
+{
+ @Override
+ protected String getExplicitContextRoot(Deployment dep)
+ {
+ String contextRoot = super.getExplicitContextRoot(dep);
+ if (contextRoot == null)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ String urlPattern = getUrlPattern(dep, ep);
+ if (urlPattern != null)
+ {
+ StringTokenizer st = new StringTokenizer(urlPattern, "/");
+ if (st.countTokens() > 1)
+ {
+ String firstToken = st.nextToken();
+ if (contextRoot != null && contextRoot.equals(firstToken) == false)
+ throw new IllegalStateException("All endpoints must share the same <context-root>: " + contextRoot + "!=" + firstToken);
+
+ contextRoot = firstToken;
+ }
+ }
+ }
+ }
+ return contextRoot;
+ }
+
+ private String getUrlPattern(Deployment dep, Endpoint ep)
+ {
+ String urlPattern = null;
+
+ EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
+ if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null)
+ {
+ EJBMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
+ urlPattern = bmd.getPortComponentURI();
+ }
+
+ return urlPattern;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,65 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.deployment.Deployment;
+
+/**
+ * Populate deployment context properties
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2006
+ */
+public class ContextPropertiesDeploymentAspect extends AbstractDeploymentAspect
+{
+ // The configured service endpoint servlet
+ private Map<String,String> contextProperties;
+
+ public Map<String, String> getContextProperties()
+ {
+ return contextProperties;
+ }
+
+ public void setContextProperties(Map<String, String> contextProperties)
+ {
+ this.contextProperties = contextProperties;
+ }
+
+ @Override
+ public void start(Deployment dep)
+ {
+ if (contextProperties != null)
+ {
+ Iterator<String> it = contextProperties.keySet().iterator();
+ while (it.hasNext())
+ {
+ String key = it.next();
+ String value = contextProperties.get(key);
+ dep.setProperty(key, value);
+ }
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,120 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.ws.Constants;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
+
+/**
+ * A deployer that assigns the context root to the service
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class ContextRootDeploymentAspect extends AbstractDeploymentAspect
+{
+ @Override
+ public void start(Deployment dep)
+ {
+ String contextRoot = dep.getService().getContextRoot();
+ if (contextRoot == null)
+ {
+ contextRoot = getExplicitContextRoot(dep);
+ if (contextRoot == null)
+ contextRoot = getImplicitContextRoot((ArchiveDeployment)dep);
+
+ // Always prefix with '/'
+ if (contextRoot.startsWith("/") == false)
+ contextRoot = "/" + contextRoot;
+
+ dep.getService().setContextRoot(contextRoot);
+ }
+ }
+
+ protected String getExplicitContextRoot(Deployment dep)
+ {
+ String contextRoot = null;
+
+ // #1 Use the explicit context root from the web meta data
+ JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
+ if (webMetaData != null)
+ contextRoot = webMetaData.getContextRoot();
+
+ // #2 Use the explicit context root from @WebContext.contextRoot
+ if (contextRoot == null)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ Class implClass = ep.getTargetBeanClass();
+ WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
+ this.validateSecuritySettings(anWebContext);
+ if (anWebContext != null && anWebContext.contextRoot().length() > 0)
+ {
+ if (contextRoot != null && contextRoot.equals(anWebContext.contextRoot()) == false)
+ throw new IllegalStateException("Context root must be the same for all deployed endpoints");
+
+ contextRoot = anWebContext.contextRoot();
+ }
+ }
+ }
+
+ // #3 Use the explicit context root from webservices/context-root
+ EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
+ if (contextRoot == null && appMetaData != null)
+ {
+ contextRoot = appMetaData.getWebServiceContextRoot();
+ }
+
+ return contextRoot;
+ }
+
+ /** Use the implicit context root derived from the deployment name
+ */
+ protected String getImplicitContextRoot(ArchiveDeployment dep)
+ {
+ String simpleName = dep.getSimpleName();
+ String contextRoot = simpleName.substring(0, simpleName.length() - 4);
+ if (dep.getParent() != null && Constants.BC_CONTEXT_MODE)
+ {
+ simpleName = dep.getParent().getSimpleName();
+ contextRoot = simpleName.substring(0, simpleName.length() - 4) + "-" + contextRoot;
+ }
+ return contextRoot;
+ }
+
+ private void validateSecuritySettings(WebContext webCtx)
+ {
+ if (webCtx != null)
+ {
+ TransportGuarantee.valueOf(webCtx.transportGuarantee());
+ AuthMethod.valueOf(webCtx.authMethod());
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeployment.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeployment.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeployment.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,119 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Service;
+
+/**
+ * A general web service deployment dep.
+ *
+ * It has no notion of J2EE deployment packages.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class DefaultDeployment extends AbstractExtensible implements Deployment
+{
+ // The name for this deployment
+ private String simpleName;
+ // A deployment has one service
+ private Service service;
+ // The type of this deployment
+ private DeploymentType type;
+ // The state for this deployment
+ private DeploymentState state;
+ // The deployment class loader
+ private ClassLoader initialLoader;
+ // The runtime class loader
+ private ClassLoader runtimeLoader;
+
+ DefaultDeployment(String name, ClassLoader classLoader)
+ {
+ simpleName = name;
+ state = DeploymentState.UNDEFINED;
+ initialLoader = classLoader;
+ setService(new DefaultService());
+ }
+
+ public String getSimpleName()
+ {
+ return simpleName;
+ }
+
+ public void setSimpleName(String name)
+ {
+ this.simpleName = name;
+ }
+
+ public void setInitialClassLoader(ClassLoader classLoader)
+ {
+ this.initialLoader = classLoader;
+ }
+
+ public ClassLoader getInitialClassLoader()
+ {
+ return initialLoader;
+ }
+
+ public void setRuntimeClassLoader(ClassLoader classLoader)
+ {
+ this.runtimeLoader = classLoader;
+ }
+
+ public ClassLoader getRuntimeClassLoader()
+ {
+ return runtimeLoader;
+ }
+
+ public Service getService()
+ {
+ return service;
+ }
+
+ public void setService(Service service)
+ {
+ service.setDeployment(this);
+ this.service = service;
+ }
+
+ public DeploymentState getState()
+ {
+ return state;
+ }
+
+ public void setState(DeploymentState deploymentState)
+ {
+ this.state = deploymentState;
+ }
+
+ public DeploymentType getType()
+ {
+ return type;
+ }
+
+ public void setType(DeploymentType deploymentType)
+ {
+ this.type = deploymentType;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentAspectManagerFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,50 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
+
+/**
+ * A DeploymentAspectManagerFactory that retrieves a configured
+ * {@link DeploymentAspectManager} from MC kernel.
+ *
+ * @see org.jboss.wsf.framework.deployment.DeploymentAspectInstaller
+ *
+ * @author Heiko.Braun(a)jboss.com
+ */
+public class DefaultDeploymentAspectManagerFactory extends DeploymentAspectManagerFactory
+{
+
+ // TODO: review this class methods, maybe only one method getDeploymentAspectManager() will be sufficient
+ public DeploymentAspectManager getDeploymentAspectManager(Deployment.DeploymentType deploymentType)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public DeploymentAspectManager getDeploymentAspectManager(String beanName)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,63 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Service;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 18, 2007
+ */
+public class DefaultDeploymentModelFactory extends DeploymentModelFactory
+{
+ public Deployment newDeployment(String simpleName, ClassLoader initialLoader)
+ {
+ return new DefaultDeployment(simpleName, initialLoader);
+ }
+
+ public Service newService()
+ {
+ return new DefaultService();
+ }
+
+ @Deprecated
+ /**
+ * Use #newHttpEndpoint(String) instead
+ */
+ public Endpoint newEndpoint(String targetBean)
+ {
+ return this.newHttpEndpoint(targetBean);
+ }
+
+ public Endpoint newHttpEndpoint(String targetBean)
+ {
+ return new DefaultHttpEndpoint(targetBean);
+ }
+
+ public Endpoint newJMSEndpoint(String targetBean)
+ {
+ return new DefaultJMSEndpoint(targetBean);
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.framework.deployment;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.HttpEndpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+
+/**
+ * DefaultHttpEndpoint implementation
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class DefaultHttpEndpoint extends AbstractDefaultEndpoint implements HttpEndpoint
+{
+
+ private static final Logger log = Logger.getLogger(DefaultHttpEndpoint.class);
+
+ DefaultHttpEndpoint(String targetBean)
+ {
+ super(targetBean);
+ }
+
+ public EndpointMetrics getEndpointMetrics()
+ {
+ return metrics;
+ }
+
+ public void setEndpointMetrics(EndpointMetrics metrics)
+ {
+ assertEndpointSetterAccess();
+ metrics.setEndpoint(this);
+ this.metrics = metrics;
+
+ }
+
+ public String getURLPattern()
+ {
+ return urlPattern;
+ }
+
+ public void setURLPattern(String urlPattern)
+ {
+ assertEndpointSetterAccess();
+ this.urlPattern = urlPattern;
+ }
+
+ public Context getJNDIContext()
+ {
+ Context retVal = null;
+
+ try
+ {
+ retVal = getInvocationHandler().getJNDIContext(this);
+ }
+ catch (NamingException e)
+ {
+ // JNDI not available neither in JSE environment nor in SAR archives
+ }
+
+ return retVal;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.framework.deployment;
+
+import java.net.URI;
+
+import javax.naming.Context;
+
+import org.jboss.wsf.spi.deployment.JMSEndpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+
+/**
+ * Default JMSEndpoint implementation
+ *
+ * @author <a href="ema(a)redhat.com">Jim Ma</a>
+ */
+public class DefaultJMSEndpoint extends AbstractDefaultEndpoint implements JMSEndpoint
+{
+
+ private String targetDestination;
+ private String replyDestination;
+ private URI requestURI;
+
+ DefaultJMSEndpoint(String targetBean)
+ {
+ super(targetBean);
+ }
+
+ @Deprecated
+ public String getURLPattern()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Deprecated
+ public void setURLPattern(String urlPattern)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getTargetDestination()
+ {
+ return targetDestination;
+ }
+
+ public void setTargetDestination(String targetDestination)
+ {
+ this.targetDestination = targetDestination;
+ }
+
+ public String getReplyDestination()
+ {
+ return replyDestination;
+ }
+
+ public void setReplyDestination(String replyDestination)
+ {
+ this.replyDestination = replyDestination;
+ }
+
+ public URI getRequestURI()
+ {
+ return this.requestURI;
+ }
+
+ public void setRequestURI(URI requestURI)
+ {
+ this.requestURI = requestURI;
+ }
+
+ public String getAddress()
+ {
+ if (getTargetDestination() != null)
+ {
+ StringBuffer address = new StringBuffer();
+ address.append("jms:jndi:" + getTargetDestination());
+ if (this.getReplyDestination() != null)
+ {
+ address.append("?replyToName =" + this.getReplyDestination());
+ }
+ return address.toString();
+ }
+ return "Not available";
+ }
+
+ //TODO:enable jms endpoint management
+ @Override
+ public EndpointMetrics getEndpointMetrics()
+ {
+ return null;
+ }
+ @Override
+ public Context getJNDIContext()
+ {
+ return null;
+ }
+
+ @Override
+ public void setEndpointMetrics(EndpointMetrics metrics)
+ {
+
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,84 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointState;
+import org.jboss.wsf.spi.deployment.LifecycleHandler;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+
+/**
+ * A basic lifecycle handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Oct-2006
+ */
+public class DefaultLifecycleHandler implements LifecycleHandler
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(getClass());
+
+ public void start(Endpoint ep)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Start: " + ep.getName());
+
+ EndpointState state = ep.getState();
+ if (state != EndpointState.UNDEFINED)
+ {
+ log.error("Cannot start endpoint in state: " + state);
+ }
+ else
+ {
+ if (ep.getEndpointMetrics() != null)
+ ep.getEndpointMetrics().start();
+
+ InvocationHandler invHandler = ep.getInvocationHandler();
+ if (invHandler == null)
+ throw new IllegalStateException("Invocation handler not available");
+ invHandler.init(ep);
+
+ ep.setState(EndpointState.STARTED);
+ }
+ }
+
+ public void stop(Endpoint ep)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Stop: " + ep.getName());
+
+ EndpointState state = ep.getState();
+ if (state != EndpointState.STARTED)
+ {
+ log.error("Cannot stop endpoint in state: " + state);
+ }
+ else
+ {
+ if (ep.getEndpointMetrics() != null)
+ ep.getEndpointMetrics().stop();
+
+ ep.setState(EndpointState.STOPPED);
+ }
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandlerFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandlerFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandlerFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,37 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
+import org.jboss.wsf.spi.deployment.LifecycleHandler;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 23, 2007
+ */
+public class DefaultLifecycleHandlerFactory extends LifecycleHandlerFactory
+{
+ public LifecycleHandler newLifecycleHandler()
+ {
+ return new DefaultLifecycleHandler();
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,117 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
+import org.jboss.wsf.spi.deployment.Service;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+import java.util.LinkedList;
+import java.util.List;
+
+
+/**
+ * A general service.
+ *
+ * Maintains a named set of Endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class DefaultService extends AbstractExtensible implements Service
+{
+ private Deployment dep;
+ private List<Endpoint> endpoints = new LinkedList<Endpoint>();
+ private String contextRoot;
+ private List<String> virtualHosts;
+
+ DefaultService()
+ {
+ }
+
+ public Deployment getDeployment()
+ {
+ return dep;
+ }
+
+ public void setDeployment(Deployment dep)
+ {
+ this.dep = dep;
+ }
+
+ public void addEndpoint(Endpoint endpoint)
+ {
+ endpoint.setService(this);
+ endpoints.add(endpoint);
+ }
+
+ public List<Endpoint> getEndpoints()
+ {
+ return endpoints;
+ }
+
+ public Endpoint getEndpointByName(String shortName)
+ {
+ Endpoint retEndpoint = null;
+ for (Endpoint ep : endpoints)
+ {
+ if (ep.getShortName().equals(shortName))
+ {
+ retEndpoint = ep;
+ break;
+ }
+ }
+ return retEndpoint;
+ }
+
+ public String getContextRoot()
+ {
+ return contextRoot;
+ }
+
+ public void setContextRoot(String contextRoot)
+ {
+ this.contextRoot = contextRoot;
+ }
+
+ public List<String> getVirtualHosts()
+ {
+ if ( virtualHosts != null )
+ {
+ final List<String> retVal = new LinkedList<String>();
+ for ( String virtualHost : virtualHosts )
+ {
+ retVal.add( virtualHost );
+ }
+ return retVal;
+ }
+
+ return null;
+ }
+
+ public void setVirtualHosts(List<String> virtualHosts)
+ {
+ this.virtualHosts = virtualHosts;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectInstaller.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectInstaller.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectInstaller.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,189 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
+
+/**
+ * A deployment aspect installer.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class DeploymentAspectInstaller
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(DeploymentAspectInstaller.class);
+
+ private DeploymentAspectManager manager;
+ private Set<DeploymentAspect> aspects;
+ private boolean sortAspectsOnCreate;
+ private Set<String> parentProvidedConditions = new HashSet<String>();
+
+ public void setManager(DeploymentAspectManager manager)
+ {
+ this.manager = manager;
+ }
+
+ public void setAspects(Set<DeploymentAspect> aspects)
+ {
+ this.aspects = aspects;
+ }
+
+ public void setSortAspectsOnCreate(boolean sortAspectsOnCreate)
+ {
+ this.sortAspectsOnCreate = sortAspectsOnCreate;
+ }
+
+ public void create()
+ {
+ List<DeploymentAspect> unsortedAspects = new ArrayList<DeploymentAspect>();
+
+ unsortedAspects.addAll(manager.getDeploymentAspects());
+ unsortedAspects.addAll(aspects);
+
+ List<DeploymentAspect> sortedAspects = unsortedAspects;
+ if (sortAspectsOnCreate)
+ {
+ // get the conditions provided by the parent
+ if (manager.getParent() != null)
+ {
+ Iterator<DeploymentAspect> it = manager.getParent().getDeploymentAspects().iterator();
+ while (it.hasNext())
+ {
+ DeploymentAspect aspect = it.next();
+ parentProvidedConditions.addAll(aspect.getProvidesAsSet());
+ }
+ }
+
+ sortedAspects = new ArrayList<DeploymentAspect>();
+ List<DeploymentAspect> allAspects = new ArrayList<DeploymentAspect>(unsortedAspects);
+
+ // Add aspects with no requirements first
+ Iterator<DeploymentAspect> itAll = allAspects.iterator();
+ while (itAll.hasNext())
+ {
+ DeploymentAspect aspect = itAll.next();
+ if (aspect.getRequires() == null || parentProvidedConditions.containsAll(aspect.getRequiresAsSet()))
+ {
+ sortedAspects.add(aspect);
+ itAll.remove();
+ }
+ }
+
+ // Add aspects that have requirements that already added aspects provide
+ itAll = allAspects.iterator();
+ while (itAll.hasNext())
+ {
+ DeploymentAspect aspect = itAll.next();
+ int index = getAspectIndex(sortedAspects, aspect);
+ if (index != -1)
+ {
+ sortedAspects.add(index, aspect);
+ itAll.remove();
+
+ itAll = allAspects.iterator(); // Hm,...
+ }
+ }
+
+ // Add LAST_DEPLOYMENT_ASPECT
+ itAll = allAspects.iterator();
+ while (itAll.hasNext())
+ {
+ DeploymentAspect aspect = itAll.next();
+ if (DeploymentAspect.LAST_DEPLOYMENT_ASPECT.equals(aspect.getRequires()))
+ {
+ sortedAspects.add(aspect);
+ itAll.remove();
+ }
+ }
+
+ if (allAspects.size() != 0)
+ throwSortException(sortedAspects, allAspects);
+ }
+ manager.setDeploymentAspects(sortedAspects);
+ }
+
+ public void destroy()
+ {
+ List<DeploymentAspect> managerAspects = new ArrayList<DeploymentAspect>();
+ managerAspects.addAll(manager.getDeploymentAspects());
+ Iterator<DeploymentAspect> it = aspects.iterator();
+ while (it.hasNext())
+ {
+ DeploymentAspect aspect = it.next();
+ managerAspects.remove(aspect);
+ }
+ manager.setDeploymentAspects(managerAspects);
+ }
+
+ private void throwSortException(List<DeploymentAspect> sortedAspects, List<DeploymentAspect> allAspects)
+ {
+ Set<String> providedConditions = new HashSet<String>();
+ for (int i = 0; i < sortedAspects.size(); i++)
+ {
+ DeploymentAspect sortedAspect = sortedAspects.get(i);
+ providedConditions.addAll(sortedAspect.getProvidesAsSet());
+ }
+
+ String exmsg = "Cannot add deployment aspect(s)";
+ StringBuilder str = new StringBuilder(exmsg);
+
+ if (manager.getParent() != null)
+ str.append("\n" + manager.getParent().getName() + " provides: " + parentProvidedConditions);
+
+ str.append("\n" + manager.getName() + " provides: " + providedConditions);
+
+ for (DeploymentAspect da : allAspects)
+ {
+ str.append("\n " + da.getClass().getName() + ", requires: " + da.getRequires());
+ }
+
+ log.error(str);
+ throw new IllegalStateException(str.toString());
+ }
+
+ private int getAspectIndex(List<DeploymentAspect> sortedAspects, DeploymentAspect aspect)
+ {
+ int index = -1;
+ Set<String> providedConditions = new HashSet<String>(parentProvidedConditions);
+ for (int i = 0; i < sortedAspects.size(); i++)
+ {
+ DeploymentAspect sortedAspect = sortedAspects.get(i);
+ providedConditions.addAll(sortedAspect.getProvidesAsSet());
+ if (providedConditions.containsAll(aspect.getRequiresAsSet()))
+ {
+ index = i + 1;
+ break;
+ }
+ }
+ return index;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,177 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
+import org.jboss.wsf.spi.deployment.WSFDeploymentException;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentState;
+
+/**
+ * A general service deployment manger.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ */
+public class DeploymentAspectManagerImpl implements DeploymentAspectManager
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(DeploymentAspectManagerImpl.class);
+
+ private String name;
+ private DeploymentAspectManager parent;
+ private List<DeploymentAspect> depAspects = new ArrayList<DeploymentAspect>();
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public DeploymentAspectManager getParent()
+ {
+ return parent;
+ }
+
+ public void setParent(DeploymentAspectManager parent)
+ {
+ this.parent = parent;
+ }
+
+ public List<DeploymentAspect> getDeploymentAspects()
+ {
+ return Collections.unmodifiableList(depAspects);
+ }
+
+ public void setDeploymentAspects(List<DeploymentAspect> aspects)
+ {
+ depAspects.clear();
+ depAspects.addAll(aspects);
+
+ if (log.isTraceEnabled())
+ {
+ // Debug the aspect list
+ StringBuilder builder = new StringBuilder("setDeploymentAspects on " + name);
+ for (DeploymentAspect aspect : aspects)
+ builder.append("\n " + aspect.getClass().getName() + " provides: " + aspect.getProvidesAsSet() + " requires: " + aspect.getRequiresAsSet());
+
+ log.trace(builder);
+ }
+ }
+
+ /**
+ * Iterate over the registered deployers calls create on each.
+ * Iterate over the registered deployers again and calls start on each.
+ * If start fails it automaticall calls destroy in the reverse order
+ * starting with the deployer that failed
+ */
+ public void deploy(Deployment dep)
+ {
+ // create the deployment
+ Set<String> providedConditions = new HashSet<String>();
+ for (int i = 0; i < getDeploymentAspects().size(); i++)
+ {
+ DeploymentAspect aspect = getDeploymentAspects().get(i);
+
+ // Check that all required aspects are met
+ /*
+ TODO: This should done by adding all provided conditions to the Deployment
+ when being executed. Otherwise we will miss the parent provided conditions here
+
+ Set<String> requiredSet = aspect.getRequiresAsSet();
+ requiredSet.remove(DeploymentAspect.LAST_DEPLOYMENT_ASPECT);
+ if (providedConditions.containsAll(requiredSet) == false)
+ throw new IllegalStateException("Required conditions '" + aspect.getRequires() + "' not satisfied by '" + providedConditions + "' for: " + aspect);
+ */
+
+ providedConditions.addAll(aspect.getProvidesAsSet());
+ }
+
+ // start the deployment
+ for (int i = 0; i < getDeploymentAspects().size(); i++)
+ {
+ DeploymentAspect aspect = getDeploymentAspects().get(i);
+ try
+ {
+ logInvocation(aspect, "Start");
+ aspect.start(dep);
+ }
+ catch (RuntimeException rte)
+ {
+ while (i-- >= 0)
+ {
+ // destroy the deployment
+ failsafeStop(aspect, dep);
+ }
+ throw rte;
+ }
+ }
+
+ dep.setState(DeploymentState.STARTED);
+ }
+
+ public void undeploy(Deployment dep)
+ {
+ for (int i = getDeploymentAspects().size(); 0 < i; i--)
+ {
+ DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
+ failsafeStop(aspect, dep);
+ }
+
+ dep.setState(DeploymentState.STOPPED);
+ }
+
+ private void failsafeStop(DeploymentAspect aspect, Deployment dep)
+ {
+ try
+ {
+ logInvocation(aspect, "Stop");
+ aspect.stop(dep);
+ }
+ catch (RuntimeException rte)
+ {
+ WSFDeploymentException.rethrow(rte);
+ }
+ }
+
+ private void logInvocation(DeploymentAspect aspect, String method)
+ {
+ if (log.isTraceEnabled())
+ {
+ String name = aspect.getClass().getName();
+ name = name.substring(name.lastIndexOf(".") + 1);
+ log.trace("[" + this.name + "]" + name + ":" + method);
+ }
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,81 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.common.ResourceLoaderAdapter;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.HttpEndpoint;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+
+/**
+ * A deployment aspect for JAXWS Endpoint API endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 31-Jul-2007
+ */
+// TODO: [JBWS-2674] review this deployment aspect once AS IL is rewritten
+public class EndpointAPIDeploymentAspect extends AbstractDeploymentAspect
+{
+ @Override
+ public void start(Deployment dep)
+ {
+ dep.setType(DeploymentType.JAXWS_JSE);
+
+ if (dep instanceof ArchiveDeployment)
+ {
+ ArchiveDeployment arc = (ArchiveDeployment)dep;
+ UnifiedVirtualFile rootFile = arc.getRootFile();
+ if (rootFile == null)
+ {
+ rootFile = new ResourceLoaderAdapter(dep.getInitialClassLoader());
+ arc.setRootFile(rootFile);
+ }
+ }
+
+ ClassLoader rtcl = dep.getRuntimeClassLoader();
+ if (rtcl == null)
+ {
+ // TODO: What's this? Look's quiet hacky...
+ log.warn("Using inital class laoder as runtime laoder. Hack?", new IllegalArgumentException());
+ dep.setRuntimeClassLoader(dep.getInitialClassLoader());
+ }
+
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ if (ep.getShortName() == null)
+ {
+ String name = ep.getTargetBeanName();
+ String shortName = name.substring(name.lastIndexOf('.') + 1);
+ ep.setShortName(shortName);
+ }
+
+ if (((HttpEndpoint)ep).getURLPattern() == null)
+ {
+ ((HttpEndpoint)ep).setURLPattern("/*");
+ }
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,174 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.HttpEndpoint;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData.JSEResourceCollection;
+
+/**
+ * A deployer that assigns the endpoint address.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2007
+ */
+public class EndpointAddressDeploymentAspect extends AbstractDeploymentAspect
+{
+ @Override
+ public void start(Deployment dep)
+ {
+ String contextRoot = dep.getService().getContextRoot();
+ if (contextRoot == null)
+ throw new IllegalStateException("Cannot obtain context root");
+
+ // TODO: remove this hack - review API
+ String protocol = (String)dep.getService().getProperty("protocol");
+ String host = (String)dep.getService().getProperty("host");
+ Integer port = (Integer)dep.getService().getProperty("port");
+ Integer securePort = null;
+
+ if (protocol == null)
+ {
+ SPIProvider provider = SPIProviderResolver.getInstance().getProvider();
+ ServerConfigFactory spi = provider.getSPI(ServerConfigFactory.class);
+ ServerConfig serverConfig = spi.getServerConfig();
+
+ host = serverConfig.getWebServiceHost();
+ port = serverConfig.getWebServicePort();
+ securePort = serverConfig.getWebServiceSecurePort();
+ }
+ Map<String, Endpoint> endpointsMap = new HashMap<String, Endpoint>();
+ List<Endpoint> deleteList = new LinkedList<Endpoint>();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ boolean confidential = isConfidentialTransportGuarantee(dep, ep);
+ int currentPort = confidential ? securePort : port;
+ String hostAndPort = host + (currentPort > 0 ? ":" + currentPort : "");
+
+ HttpEndpoint httpEp = (HttpEndpoint)ep;
+ String urlPattern = httpEp.getURLPattern();
+ if (urlPattern == null)
+ throw new IllegalStateException("Cannot obtain url pattern");
+
+ if (urlPattern.endsWith("/*"))
+ urlPattern = urlPattern.substring(0, urlPattern.length() - 2);
+
+ protocol = confidential ? "https://" : "http://";
+ String address = protocol + hostAndPort + contextRoot + urlPattern;
+ httpEp.setAddress(address);
+ //JBWS-2957: EJB3 binds the same endpoint class to multiple beans at multiple JNDI locations;
+ //generally speaking we can't have multiple endpoints published at the same address and we
+ //can't ensure that completely in AS integration, since the publish address is final just here
+ if (!endpointsMap.containsKey(address))
+ {
+ endpointsMap.put(address, httpEp);
+ }
+ else
+ {
+ deleteList.add(httpEp);
+ }
+ }
+ //Remove endpoints with duplicated address
+ for (Endpoint ep : deleteList)
+ {
+ dep.getService().getEndpoints().remove(ep);
+ }
+ }
+
+ protected boolean isConfidentialTransportGuarantee(Deployment dep, Endpoint ep)
+ {
+ String transportGuarantee = null;
+ if (DeploymentType.JAXWS_JSE == dep.getType())
+ {
+ JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
+ if (webMetaData != null)
+ {
+ String servletLink = ep.getShortName();
+ Map<String, String> servletMappings = webMetaData.getServletMappings();
+ String urlPattern = servletMappings.get(servletLink);
+
+ if (urlPattern == null)
+ throw new RuntimeException("Cannot find <url-pattern> for servlet-name: " + servletLink);
+
+ List<JSESecurityMetaData> securityList = webMetaData.getSecurityMetaData();
+ for (JSESecurityMetaData currentSecurity : securityList)
+ {
+ if (currentSecurity.getTransportGuarantee() != null && currentSecurity.getTransportGuarantee().length() > 0)
+ {
+ for (JSEResourceCollection currentCollection : currentSecurity.getWebResources())
+ {
+ for (String currentUrlPattern : currentCollection.getUrlPatterns())
+ {
+ if (urlPattern.equals(currentUrlPattern) || "/*".equals(currentUrlPattern))
+ {
+ transportGuarantee = currentSecurity.getTransportGuarantee();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else if (DeploymentType.JAXWS_EJB3 == dep.getType())
+ {
+ //TODO Unify annotation scans
+ Class implClass = ep.getTargetBeanClass();
+ WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
+ if (anWebContext != null)
+ {
+ transportGuarantee = anWebContext.transportGuarantee();
+ }
+ if (anWebContext == null || transportGuarantee == null || transportGuarantee.length() == 0)
+ {
+ String ejbName = ep.getShortName();
+ EJBArchiveMetaData ejbArchiveMD = dep.getAttachment(EJBArchiveMetaData.class);
+ EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null;
+ EJBSecurityMetaData ejbSecurityMD = ejbMD != null ? ejbMD.getSecurityMetaData() : null;
+
+ if (ejbSecurityMD != null)
+ {
+ transportGuarantee = ejbSecurityMD.getTransportGuarantee();
+ }
+ }
+ }
+ return "CONFIDENTIAL".equals(transportGuarantee);
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,113 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.LifecycleHandler;
+import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
+import org.jboss.wsf.spi.invocation.InvocationType;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.invocation.RequestHandlerFactory;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.MDBMetaData;
+
+/**
+ * A deployer that assigns the handlers to the Endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class EndpointHandlerDeploymentAspect extends AbstractDeploymentAspect
+{
+ private SPIProvider spiProvider;
+
+ public EndpointHandlerDeploymentAspect()
+ {
+ super();
+ spiProvider = SPIProviderResolver.getInstance().getProvider();
+ }
+
+ @Override
+ public void start(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ // Associate a request handler
+ ep.setRequestHandler(getRequestHandler(dep));
+
+ // Associate a lifecycle handler
+ ep.setLifecycleHandler(getLifecycleHandler(dep));
+
+ // Associate an invocation handler
+ // Invocation handlers are assigned per container or per stack
+ InvocationHandler invocationHandler = getInvocationHandler(ep);
+ if (invocationHandler != null)
+ ep.setInvocationHandler(invocationHandler);
+
+ }
+ }
+
+ private RequestHandler getRequestHandler(Deployment dep)
+ {
+ return spiProvider.getSPI(RequestHandlerFactory.class).newRequestHandler();
+ }
+
+ private LifecycleHandler getLifecycleHandler(Deployment dep)
+ {
+ return spiProvider.getSPI(LifecycleHandlerFactory.class).newLifecycleHandler();
+ }
+
+ private InvocationHandler getInvocationHandler(Endpoint ep)
+ {
+ Deployment dep = ep.getService().getDeployment();
+ DeploymentType depType = dep.getType();
+
+ String key = depType.toString();
+
+ // Use a special key for MDB endpoints
+ EJBArchiveMetaData uapp = dep.getAttachment(EJBArchiveMetaData.class);
+ if (uapp != null)
+ {
+ EJBMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
+ if (depType == DeploymentType.JAXRPC_EJB21 && bmd instanceof MDBMetaData)
+ {
+ key = InvocationType.JAXRPC_MDB21.toString();
+ }
+ else if (depType == DeploymentType.JAXWS_EJB3 && bmd instanceof MDBMetaData)
+ {
+ key = InvocationType.JAXWS_MDB3.toString();
+ }
+ }
+
+ InvocationType type = InvocationType.valueOf(key);
+ InvocationHandler invocationHandler = spiProvider.getSPI(InvocationHandlerFactory.class).newInvocationHandler(type);
+ return invocationHandler;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,72 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.LifecycleHandler;
+import org.jboss.wsf.spi.deployment.Service;
+
+/**
+ * A deployer that that calls the endpoint lifecycle handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class EndpointLifecycleDeploymentAspect extends AbstractDeploymentAspect
+{
+
+ @Override
+ public void start(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ getLifecycleHandler(ep, true).start(ep);
+ }
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ Service service = dep.getService();
+ if (service != null)
+ {
+ for (Endpoint ep : service.getEndpoints())
+ {
+ LifecycleHandler lifecycleHandler = getLifecycleHandler(ep, false);
+ if (lifecycleHandler != null)
+ lifecycleHandler.stop(ep);
+ }
+ }
+ }
+
+ private LifecycleHandler getLifecycleHandler(Endpoint ep, boolean assertHandler)
+ {
+ LifecycleHandler lifecycleHandler = ep.getLifecycleHandler();
+ if (lifecycleHandler == null && assertHandler)
+ throw new IllegalStateException("LifecycleHandler not initialised");
+
+ return lifecycleHandler;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,51 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.EndpointMetricsFactory;
+
+/**
+ * A deployer that assigns the metrics to the Endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 20-Jun-2007
+ */
+public class EndpointMetricsDeploymentAspect extends AbstractDeploymentAspect
+{
+ @Override
+ public void start(Deployment dep)
+ {
+ SPIProvider provider = SPIProviderResolver.getInstance().getProvider();
+ EndpointMetricsFactory factory = provider.getSPI(EndpointMetricsFactory.class);
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ EndpointMetrics metrics = factory.newEndpointMetrics();
+ ep.setEndpointMetrics(metrics);
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,68 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.MDBMetaData;
+
+/**
+ * A deployer that assigns the complete name to the Endpoint
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class EndpointNameDeploymentAspect extends AbstractDeploymentAspect
+{
+ @Override
+ public void start(Deployment dep)
+ {
+ String contextRoot = dep.getService().getContextRoot();
+ if (contextRoot == null || contextRoot.startsWith("/") == false)
+ throw new IllegalStateException("Context root expected to start with leading slash: " + contextRoot);
+
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ StringBuilder name = new StringBuilder(Endpoint.SEPID_DOMAIN + ":");
+ name.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextRoot.substring(1) + ",");
+ name.append(Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ep.getShortName());
+
+ // Append the JMS destination, for an MDB endpoint
+ EJBArchiveMetaData uapp = dep.getAttachment(EJBArchiveMetaData.class);
+ if (uapp != null)
+ {
+ EJBMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
+ if (bmd instanceof MDBMetaData)
+ {
+ String destName = ((MDBMetaData)bmd).getDestinationJndiName();
+ name.append(",jms=" + destName);
+ }
+ }
+
+ ep.setName(ObjectNameFactory.create(name.toString()));
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,133 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.framework.management.recording.ManagedRecordProcessor;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * A deployer that sets the record processors for each endpoint
+ *
+ * @author alessio.soldano(a)jboss.org
+ * @since 12-Dec-2007
+ */
+public class EndpointRecordProcessorDeploymentAspect extends AbstractDeploymentAspect
+{
+ private MBeanServer mbeanServer;
+ private List<RecordProcessor> processors;
+
+ public void setProcessors(List<RecordProcessor> processors)
+ {
+ this.processors = processors;
+ }
+
+ @Override
+ public void start(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ List<RecordProcessor> processorList = new LinkedList<RecordProcessor>();
+ if (processors != null)
+ {
+ for (RecordProcessor pr : processors)
+ {
+ try
+ {
+ RecordProcessor clone = (RecordProcessor)pr.clone();
+ registerRecordProcessor(clone, ep);
+ processorList.add(clone);
+ }
+ catch (CloneNotSupportedException ex)
+ {
+ throw new RuntimeException(ex);
+ }
+ }
+ }
+ ep.setRecordProcessors(processorList);
+ }
+ }
+
+ @Override
+ public void stop(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ List<RecordProcessor> processors = ep.getRecordProcessors();
+ for (RecordProcessor processor : processors)
+ {
+ this.unregisterRecordProcessor(processor, ep);
+ }
+ }
+ }
+
+ private void registerRecordProcessor(RecordProcessor processor, Endpoint ep)
+ {
+ try
+ {
+ mbeanServer.registerMBean(processor, ObjectNameFactory.create(ep.getName() + ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.debug("Cannot register endpoint with JMX server, trying with the default ManagedRecordProcessor: " + ex.getMessage());
+ try
+ {
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor), ObjectNameFactory.create(ep.getName() + ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException innerEx)
+ {
+ log.error("Cannot register endpoint with JMX server", innerEx);
+ }
+ }
+ }
+
+ private void unregisterRecordProcessor(RecordProcessor processor, Endpoint ep)
+ {
+ try
+ {
+ mbeanServer.unregisterMBean(ObjectNameFactory.create(ep.getName() + ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot unregister record processor with JMX server", ex);
+ }
+ }
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,63 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+
+/**
+ * A deployer that registers the endpoints
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ */
+public class EndpointRegistryDeploymentAspect extends AbstractDeploymentAspect
+{
+ private EndpointRegistry registry;
+
+ public void start(Deployment dep)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ if (registry == null)
+ registry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ registry.register(ep);
+ }
+ }
+
+ public void stop(Deployment dep)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ if (registry == null)
+ registry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ registry.unregister(ep);
+ }
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/JAXBIntroDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/JAXBIntroDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/JAXBIntroDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.wsf.framework.deployment;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.jboss.jaxb.intros.BindingCustomizationFactory;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.binding.BindingCustomization;
+import org.jboss.wsf.spi.binding.JAXBBindingCustomization;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+
+/**
+ * Installs jaxbintro binding customization into the deployment
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
+ */
+public class JAXBIntroDeploymentAspect extends AbstractDeploymentAspect
+{
+ private static Logger logger = Logger.getLogger(JAXBIntroDeploymentAspect.class);
+ private static final String META_INF_JAXB_INTROS_XML = "META-INF/jaxb-intros.xml";
+ private static final String WEB_INF_JAXB_INTROS_XML = "WEB-INF/jaxb-intros.xml";
+
+ public void start(Deployment deployment)
+ {
+ // assert ArchiveDeployment
+ if(! (deployment instanceof ArchiveDeployment) )
+ {
+ if (log.isTraceEnabled())
+ log.trace("JAXBIntroDeploymentAspect doesn't work on " + deployment.getClass());
+ return;
+ }
+
+ ArchiveDeployment archive = (ArchiveDeployment)deployment;
+ InputStream introsConfigStream = null;
+
+ try
+ {
+ // META-INF first
+ UnifiedVirtualFile vfs = archive.getRootFile().findChild(META_INF_JAXB_INTROS_XML);
+ introsConfigStream = vfs.toURL().openStream();
+ } catch (Exception e) {}
+
+ if(null == introsConfigStream)
+ {
+ try
+ {
+ // WEB-INF second
+ UnifiedVirtualFile vfs = archive.getRootFile().findChild(WEB_INF_JAXB_INTROS_XML);
+ introsConfigStream = vfs.toURL().openStream();
+ } catch (Exception e) {
+ return;
+ }
+ }
+
+ try
+ {
+
+ if(introsConfigStream != null)
+ {
+ BindingCustomization jaxbCustomizations = new JAXBBindingCustomization();
+ BindingCustomizationFactory.populateBindingCustomization(introsConfigStream, jaxbCustomizations);
+
+ // Add the customizations to the deployment too; later consumed by BusDeploymentAspect in CXF stack
+ deployment.addAttachment(BindingCustomization.class, jaxbCustomizations);
+ // JBossWSBeanConfigurer#configureService becomes the consumer later on
+ for(Endpoint endpoint : deployment.getService().getEndpoints())
+ {
+ endpoint.addAttachment(BindingCustomization.class, jaxbCustomizations);
+ }
+
+ }
+
+ }
+ finally
+ {
+ if(introsConfigStream != null)
+ {
+ try {
+ introsConfigStream.close();
+ } catch (IOException e) {
+ logger.error("[" + deployment.getService().getContextRoot() + "] Error closing JAXB Introductions Configurations stream ", e);
+ }
+ }
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/ResourceResolverImpl.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.wsf.framework.deployment;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.ResourceResolver;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+
+/**
+ * A resource resolver implementation using unified virtual files
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Nov-2009
+ *
+ */
+public class ResourceResolverImpl implements ResourceResolver
+{
+ private static Logger log = Logger.getLogger(ResourceResolverImpl.class);
+
+ private UnifiedVirtualFile rootFile;
+ private Collection<UnifiedVirtualFile> metadataFiles;
+
+ public ResourceResolverImpl(UnifiedVirtualFile rootFile, Collection<UnifiedVirtualFile> metadataFiles)
+ {
+ this.rootFile = rootFile;
+ this.metadataFiles = metadataFiles;
+ }
+
+ public URL resolve(String resourcePath) throws IOException
+ {
+ URL resourceURL = null;
+ if (resourcePath != null && resourcePath.length() > 0)
+ {
+ if (resourcePath.startsWith("/"))
+ resourcePath = resourcePath.substring(1);
+
+ try
+ {
+ // assign an absolute URL
+ resourceURL = new URL(resourcePath);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ if (resourceURL == null && rootFile != null)
+ {
+ try
+ {
+ UnifiedVirtualFile vfResource = rootFile.findChild(resourcePath);
+ resourceURL = vfResource.toURL();
+ }
+ catch (IOException e)
+ {
+ if (metadataFiles == null || metadataFiles.isEmpty())
+ {
+ throw e;
+ }
+ else
+ {
+ if (log.isTraceEnabled())
+ log.trace("Cannot get " + resourcePath + " from root file, trying with additional metadata files", e);
+ }
+ }
+ }
+ //scan additional metadata files (for instance originally attached to a VFSDeploymentUnit)
+ if (resourceURL == null && metadataFiles != null && !metadataFiles.isEmpty())
+ {
+ UnifiedVirtualFile vfResource = null;
+ for (Iterator<UnifiedVirtualFile> it = metadataFiles.iterator(); it.hasNext() && vfResource == null;)
+ {
+ UnifiedVirtualFile uvf = it.next();
+ URL wsdlUrl = uvf.toURL();
+ String wsdlPath = wsdlUrl.getPath();
+ if (wsdlPath.startsWith("/"))
+ wsdlPath = wsdlPath.substring(1);
+ if (resourcePath.equals(wsdlPath))
+ {
+ vfResource = uvf;
+ }
+ else
+ {
+ try
+ {
+ vfResource = uvf.findChild(resourcePath);
+ }
+ catch (IOException e)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Cannot get " + resourcePath + " from " + uvf, e);
+ }
+ }
+ }
+ if (vfResource == null)
+ throw new IOException("Could not find " + resourcePath + " in the additional metadatafiles!");
+
+ resourceURL = vfResource.toURL();
+ }
+ }
+ return resourceURL;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,145 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.StringTokenizer;
+
+import javax.jws.WebService;
+
+import org.jboss.ws.Constants;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.HttpEndpoint;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
+
+/**
+ * A deployer that assigns the URLPattern to endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 19-May-2007
+ */
+public class URLPatternDeploymentAspect extends AbstractDeploymentAspect
+{
+
+ @Override
+ public void start(Deployment dep)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ HttpEndpoint httpEp = (HttpEndpoint)ep;
+ String urlPattern = httpEp.getURLPattern();
+ if (urlPattern == null)
+ {
+ urlPattern = getExplicitPattern(dep, ep);
+ if (urlPattern == null)
+ urlPattern = getImplicitPattern(dep, ep);
+
+ // Always prefix with '/'
+ if (urlPattern.startsWith("/") == false)
+ urlPattern = "/" + urlPattern;
+
+ httpEp.setURLPattern(urlPattern);
+ }
+ }
+ }
+
+ protected String getExplicitPattern(Deployment dep, Endpoint ep)
+ {
+ String urlPattern = null;
+
+ // #1 For JSE lookup the url-pattern from the servlet mappings
+ JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
+ if (webMetaData != null)
+ {
+ String epName = ep.getShortName();
+ urlPattern = webMetaData.getServletMappings().get(epName);
+ if (urlPattern == null)
+ throw new IllegalStateException("Cannot obtain servlet mapping for: " + epName);
+ }
+
+ // #2 Use the explicit urlPattern from port-component/port-component-uri
+ EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
+ if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null)
+ {
+ EJBMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
+ urlPattern = bmd.getPortComponentURI();
+ if (urlPattern != null)
+ {
+ String contextRoot = dep.getService().getContextRoot();
+
+ if (urlPattern.startsWith("/") == false)
+ urlPattern = "/" + urlPattern;
+
+ StringTokenizer st = new StringTokenizer(urlPattern, "/");
+ if (st.countTokens() > 1 && urlPattern.startsWith(contextRoot + "/"))
+ {
+ urlPattern = urlPattern.substring(contextRoot.length());
+ }
+ }
+ }
+
+ // #3 For EJB use @WebContext.urlPattern
+ if (urlPattern == null)
+ {
+ Class beanClass = ep.getTargetBeanClass();
+ WebContext anWebContext = (WebContext)beanClass.getAnnotation(WebContext.class);
+ if (anWebContext != null && anWebContext.urlPattern().length() > 0)
+ {
+ urlPattern = anWebContext.urlPattern();
+ }
+ else if (!Constants.BC_CONTEXT_MODE)
+ {
+ WebService webServiceAnnotation = (WebService)beanClass.getAnnotation(WebService.class);
+ String name = webServiceAnnotation != null ? webServiceAnnotation.name() : null;
+ if (name != null && name.length() > 0)
+ {
+ urlPattern = name;
+ }
+ else
+ {
+ String fullClassName = beanClass.getName();
+ urlPattern = fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
+ }
+ if (webServiceAnnotation != null && !"".equals(webServiceAnnotation.serviceName()))
+ {
+ urlPattern = webServiceAnnotation.serviceName() + "/" + urlPattern;
+ }
+
+ }
+
+ }
+
+ return urlPattern;
+ }
+
+ protected String getImplicitPattern(Deployment dep, Endpoint ep)
+ {
+ // #4 Fallback to the ejb-name
+ String urlPattern = ep.getShortName();
+ return urlPattern;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,92 @@
+/*
+ * 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.wsf.framework.deployment;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+
+/**
+ * A deployer that assigns the virtual hosts to the service
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 10-Jul-2008
+ */
+public class VirtualHostDeploymentAspect extends AbstractDeploymentAspect
+{
+
+ @Override
+ public void start(Deployment dep)
+ {
+ if ( DeploymentType.JAXWS_EJB3.equals(dep.getType()))
+ {
+ dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
+ }
+ }
+
+ protected List<String> getExplicitVirtualHosts(Deployment dep)
+ {
+ String[] virtualHosts = null;
+
+ // Use the virtual hosts from @WebContext.virtualHosts
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ Class implClass = ep.getTargetBeanClass();
+ WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
+ if (anWebContext != null && anWebContext.virtualHosts() != null && anWebContext.virtualHosts().length > 0)
+ {
+ String[] anVirtualHosts = anWebContext.virtualHosts();
+ // Avoid modifying the annotation values.
+ String[] temp = new String[anVirtualHosts.length];
+ System.arraycopy(anVirtualHosts, 0, temp, 0, anVirtualHosts.length);
+ Arrays.sort(temp);
+
+ if (virtualHosts == null)
+ {
+ virtualHosts = temp;
+ }
+ else
+ {
+ if (Arrays.equals(virtualHosts, temp) == false)
+ {
+ throw new IllegalStateException("virtualHosts must be the same for all deployed endpoints");
+ }
+ }
+ }
+ }
+
+ if ( virtualHosts != null )
+ {
+ return Arrays.asList(virtualHosts);
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/WebservicesDescriptorParserImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/WebservicesDescriptorParserImpl.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/WebservicesDescriptorParserImpl.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.framework.deployment;
+
+import java.net.URL;
+
+import org.jboss.wsf.spi.metadata.webservices.WebservicesDescriptorParser;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesFactory;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
+
+/**
+ * Webservices descriptor parser implementation.
+ *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ * @author alessio.soldano(a)jboss.com
+ */
+public final class WebservicesDescriptorParserImpl implements WebservicesDescriptorParser
+{
+ private String descriptorName;
+
+ @Override
+ public String getDescriptorName()
+ {
+ return this.descriptorName;
+ }
+
+ /**
+ * Invoked via MC.
+ * @param descriptorName
+ */
+ public void setDescriptorName(final String descriptorName)
+ {
+ this.descriptorName = descriptorName;
+ }
+
+ @Override
+ public WebservicesMetaData parse(URL url)
+ {
+ return WebservicesFactory.load(url);
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/WebservicesDescriptorProcessorImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/WebservicesDescriptorProcessorImpl.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/WebservicesDescriptorProcessorImpl.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.framework.deployment.jms;
+
+import org.jboss.wsf.spi.metadata.webservices.WebservicesDescriptorProcessor;
+
+/**
+ * Webservices descriptor processor implementation.
+ *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+@Deprecated
+public final class WebservicesDescriptorProcessorImpl implements WebservicesDescriptorProcessor
+{
+ private String descriptorName;
+ private boolean isValidating;
+
+ /* (non-Javadoc)
+ * @see org.jboss.wsf.spi.metadata.DescriptorProcessor#getDescriptorName()
+ */
+ @Override
+ public String getDescriptorName()
+ {
+ return this.descriptorName;
+ }
+
+ /**
+ * Invoked via MC.
+ * @param descriptorName
+ */
+ public void setDescriptorName(final String descriptorName)
+ {
+ this.descriptorName = descriptorName;
+ }
+
+// /* (non-Javadoc)
+// * @see org.jboss.wsf.spi.metadata.DescriptorProcessor#getFactory(java.net.URL)
+// */
+// public ObjectModelFactory getFactory(final URL url)
+// {
+// if (url == null)
+// throw new IllegalArgumentException("URL cannot be null");
+//
+// return new WebservicesFactory(url);
+// }
+
+ /* (non-Javadoc)
+ * @see org.jboss.wsf.spi.metadata.DescriptorProcessor#isValidating()
+ */
+ @Override
+ public boolean isValidating()
+ {
+ return this.isValidating;
+ }
+
+ /**
+ * Invoked via MC.
+ * @param isValidating
+ */
+ public void setValidating(final boolean isValidating)
+ {
+ this.isValidating = isValidating;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/invocation/DefaultResourceInjectorFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/invocation/DefaultResourceInjectorFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/invocation/DefaultResourceInjectorFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,37 @@
+/*
+ * 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.wsf.framework.invocation;
+
+import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
+import org.jboss.wsf.spi.invocation.ResourceInjector;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 19, 2007
+ */
+public class DefaultResourceInjectorFactory extends ResourceInjectorFactory
+{
+ public ResourceInjector newResourceInjector()
+ {
+ return new WebServiceContextInjector();
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/invocation/RecordingServerHandler.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,181 @@
+/*
+ * 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.wsf.framework.invocation;
+
+
+import java.net.URL;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.framework.management.recording.RecordFactory;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.EndpointAssociation;
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordGroupAssociation;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+import org.jboss.wsf.spi.management.recording.Record.MessageType;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * This handler is responsible for collecting the information about the
+ * messages being exchanged and recording them on the server side. This
+ * is performed delegating to the RecordProcessors installed into the
+ * current endpoint.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class RecordingServerHandler extends GenericSOAPHandler
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(RecordingServerHandler.class);
+
+ @SuppressWarnings("unchecked")
+ protected boolean handleInbound(MessageContext ctx)
+ {
+ Endpoint endpoint = EndpointAssociation.getEndpoint();
+ if (endpoint != null && isRecording(endpoint))
+ {
+ Record record = RecordFactory.newRecord();
+ RecordGroupAssociation.pushGroupID(record.getGroupID());
+ record.setDate(new Date());
+ HttpServletRequest httpServletRequest = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST);
+ if (httpServletRequest != null)
+ {
+ try
+ {
+ record.setDestinationHost(new URL(httpServletRequest.getRequestURL().toString()).getHost());
+ record.setSourceHost(httpServletRequest.getRemoteHost());
+ }
+ catch (Exception e)
+ {
+ log.warn("Unable to read from the http servlet request! " + e.getMessage());
+ }
+ }
+ record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_REQUEST_HEADERS)));
+ record.setMessageType(MessageType.INBOUND);
+ record.setOperation((QName)ctx.get(MessageContext.WSDL_OPERATION));
+ boolean processEnvelope = false;
+ for (Iterator<RecordProcessor> it = endpoint.getRecordProcessors().iterator(); it.hasNext() && !processEnvelope; )
+ {
+ processEnvelope = it.next().isProcessEnvelope();
+ }
+ if (processEnvelope) //skip message processing if not required since it's very time-consuming
+ {
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+ try
+ {
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ record.setEnvelope(DOMWriter.printNode(soapEnv, true));
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot trace SOAPMessage", ex);
+ }
+ }
+ endpoint.processRecord(record);
+ }
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected boolean handleOutbound(MessageContext ctx)
+ {
+ Endpoint endpoint = EndpointAssociation.getEndpoint();
+ if (endpoint != null && isRecording(endpoint))
+ {
+ String groupID = RecordGroupAssociation.popGroupID();
+ Record record = RecordFactory.newRecord(groupID);
+ record.setDate(new Date());
+ record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_RESPONSE_HEADERS)));
+ record.setMessageType(MessageType.OUTBOUND);
+ record.setOperation((QName)ctx.get(MessageContext.WSDL_OPERATION));
+ boolean processEnvelope = false;
+ for (Iterator<RecordProcessor> it = endpoint.getRecordProcessors().iterator(); it.hasNext() && !processEnvelope; )
+ {
+ processEnvelope = it.next().isProcessEnvelope();
+ }
+ if (processEnvelope) //skip message processing if not required since it's very time-consuming
+ {
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+ try
+ {
+ SOAPEnvelope soapEnv = soapCtx.getMessage().getSOAPPart().getEnvelope();
+ if (soapEnv != null)
+ {
+ record.setEnvelope(DOMWriter.printNode(soapEnv, true));
+ }
+ }
+ catch (SOAPException ex)
+ {
+ log.error("Cannot trace SOAPMessage", ex);
+ }
+ }
+ endpoint.processRecord(record);
+ }
+ return true;
+ }
+
+ public boolean handleFault(MessageContext ctx)
+ {
+ return handleOutbound(ctx);
+ }
+
+ /**
+ * Returns true if there's at least a record processor in recording mode
+ *
+ * @param endpoint
+ * @return
+ */
+ private boolean isRecording(Endpoint endpoint)
+ {
+ List<RecordProcessor> processors = endpoint.getRecordProcessors();
+ if (processors == null || processors.isEmpty())
+ {
+ return false;
+ }
+ for (RecordProcessor processor : processors)
+ {
+ if (processor.isRecording())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,41 @@
+/*
+ * 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.wsf.framework.invocation;
+
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.wsf.common.injection.InjectionHelper;
+import org.jboss.wsf.spi.invocation.ResourceInjector;
+
+/**
+ * Inject the JAXWS WebServiceContext
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author ropalka(a)redhat.com
+ */
+public class WebServiceContextInjector extends ResourceInjector
+{
+ public void inject(Object instance, WebServiceContext context)
+ {
+ InjectionHelper.injectWebServiceContext(instance, context);
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,226 @@
+/*
+ * 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.wsf.framework.management;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.net.URL;
+import java.util.Set;
+
+import javax.management.ObjectName;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+
+/**
+ * The servlet that that is associated with context /jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2005
+ */
+public class ContextServlet extends HttpServlet
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(ContextServlet.class);
+
+ protected EndpointRegistry epRegistry;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ epRegistry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+ }
+
+ /** Process GET requests.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ PrintWriter writer = res.getWriter();
+ res.setContentType("text/html");
+
+ writer.print("<html>");
+ setupHTMLResponseHeader(writer);
+
+ URL requestURL = new URL(req.getRequestURL().toString());
+
+ writer.print("<body>");
+
+ writer.print("<div class='pageHeader'>JBossWS/Services</div>");
+ writer.print("<div class='pageSection'>");
+ writer.print("<fieldset>");
+ writer.print("<legend><b>Registered Service Endpoints</b></legend>");
+ writer.print("<table>");
+
+ // begin iteration
+ Set<ObjectName> epNames = epRegistry.getEndpoints();
+
+ if (epNames.isEmpty())
+ {
+ writer.print("<tr>");
+ writer.print(" <td><h3>There are currently no endpoints deployed</h3></td>");
+ writer.print("</tr>");
+ }
+
+ for (ObjectName oname : epNames)
+ {
+ Endpoint ep = epRegistry.getEndpoint(oname);
+
+ writer.print("<tr>");
+ writer.print(" <td>Endpoint Name</td>");
+ writer.print(" <td>" + ep.getName() + "</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>Endpoint Address</td>");
+ writer.print(" <td>" + getAddressHtmlTag(requestURL, ep) + "</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td colspan=2>");
+ writer.print(" ");
+ writer.print("");
+
+ EndpointMetrics metrics = ep.getEndpointMetrics();
+ if (metrics != null)
+ {
+ writer.print("<table class='metrics'>");
+ writer.print("<tr>");
+ writer.print(" <td>StartTime</td>");
+ writer.print(" <td>StopTime</td>");
+ writer.print(" <td></td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>" + metrics.getStartTime() + "</td>");
+
+ String stopTime = metrics.getStopTime() != null ? metrics.getStopTime().toString() : "";
+ writer.print(" <td>" + stopTime + "</td>");
+ writer.print(" <td></td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+
+ writer.print(" <td>RequestCount</td>");
+ writer.print(" <td>ResponseCount</td>");
+ writer.print(" <td>FaultCount</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>" + metrics.getRequestCount() + "</td>");
+ writer.print(" <td>" + metrics.getResponseCount() + "</td>");
+ writer.print(" <td>" + metrics.getFaultCount() + "</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>MinProcessingTime</td>");
+ writer.print(" <td>MaxProcessingTime</td>");
+ writer.print(" <td>AvgProcessingTime</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>" + metrics.getMinProcessingTime() + "</td>");
+ writer.print(" <td>" + metrics.getMaxProcessingTime() + "</td>");
+ writer.print(" <td>" + metrics.getAverageProcessingTime() + "</td>");
+ writer.print("</tr>");
+ writer.print("");
+ writer.print("");
+ writer.print("</table>");
+ writer.print("");
+ }
+
+ writer.print(" </td>");
+ writer.print("</tr>");
+
+ writer.print("<tr><td colspan='3'> </td></tr>");
+ }
+ // end iteration
+ writer.print("</table>");
+ writer.print("");
+ writer.print("</fieldset>");
+ writer.print("</div>");
+
+ writer.print("</body>");
+ writer.print("</html>");
+ writer.close();
+ }
+
+ private void setupHTMLResponseHeader(PrintWriter writer)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ writer.println("<head>");
+ writer.println("<meta http-equiv='Content-Type content='text/html; charset=iso-8859-1'>");
+ writer.println("<title>JBossWS / " + serverConfig.getImplementationVersion() + "</title>");
+ writer.println("<link rel='stylesheet' href='./styles.css'>");
+ writer.println("</head>");
+ }
+
+ private String getAddressHtmlTag(final URL requestURL, final Endpoint ep) throws IOException
+ {
+ String address = createAddress(requestURL, ep.getAddress());
+
+ if (address.startsWith("jms"))
+ {
+ return ep.getAddress();
+ }
+
+ StringBuilder sb = new StringBuilder("<a href='");
+ sb.append(address);
+ sb.append("?wsdl'>");
+ sb.append(address);
+ sb.append("</a>");
+ return sb.toString();
+ }
+
+ private String createAddress(final URL requestURL, final String endpointAddress) throws IOException
+ {
+ String address = endpointAddress;
+ if (address.contains(ServerConfig.UNDEFINED_HOSTNAME))
+ {
+ URL internalAddress = new URL(address);
+
+ String protocol = requestURL.getProtocol();
+ String host = requestURL.getHost();
+ int port = requestURL.getPort();
+ String path = internalAddress.getPath();
+
+ if (port > -1)
+ {
+ address = new URL(protocol, host, port, path).toString();
+ }
+ else
+ {
+ address = new URL(protocol, host, path).toString();
+ }
+ }
+
+ return address;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointMetricsFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointMetricsFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointMetricsFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,40 @@
+/*
+ * 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.wsf.framework.management;
+
+import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.EndpointMetricsFactory;
+
+/**
+ * Endpoint Metrics factory
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-Aug-2007
+ */
+public class DefaultEndpointMetricsFactory extends EndpointMetricsFactory
+{
+ @Override
+ public EndpointMetrics newEndpointMetrics()
+ {
+ return new EndpointMetricsImpl();
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistry.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistry.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistry.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,105 @@
+/*
+ * 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.wsf.framework.management;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointResolver;
+
+import javax.management.ObjectName;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * A general endpoint registry.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class DefaultEndpointRegistry implements EndpointRegistry
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(DefaultEndpointRegistry.class);
+
+ private Map<ObjectName, Endpoint> endpoints = new HashMap<ObjectName, Endpoint>();
+
+ public Endpoint getEndpoint(ObjectName epName)
+ {
+ if (epName == null)
+ throw new IllegalArgumentException("Endpoint name cannot be null");
+
+ if (isRegistered(epName) == false)
+ throw new IllegalStateException("Endpoint not registered: " + epName);
+
+ Endpoint endpoint = endpoints.get(epName);
+ return endpoint;
+ }
+
+ public Endpoint resolve(EndpointResolver resolver)
+ {
+ return resolver.query(endpoints.values().iterator());
+ }
+
+ public boolean isRegistered(ObjectName epName)
+ {
+ if (epName == null)
+ throw new IllegalArgumentException("Endpoint name cannot be null");
+
+ return endpoints.get(epName) != null;
+ }
+
+ public Set<ObjectName> getEndpoints()
+ {
+ return endpoints.keySet();
+ }
+
+ public void register(Endpoint endpoint)
+ {
+ if (endpoint == null)
+ throw new IllegalArgumentException("Endpoint cannot be null");
+
+ ObjectName epName = endpoint.getName();
+ if (epName == null)
+ throw new IllegalStateException("Endpoint name cannot be null for: " + endpoint);
+
+ if (isRegistered(epName))
+ throw new IllegalStateException("Endpoint already registered: " + epName);
+
+ log.info("register: " + epName);
+ endpoints.put(epName, endpoint);
+ }
+
+ public void unregister(Endpoint endpoint)
+ {
+ if (endpoint == null)
+ throw new IllegalArgumentException("Endpoint cannot be null");
+
+ ObjectName epName = endpoint.getName();
+ if (isRegistered(epName) == false)
+ throw new IllegalStateException("Endpoint not registered: " + epName);
+
+ log.info("remove: " + epName);
+ endpoints.remove(epName);
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultEndpointRegistryFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.wsf.framework.management;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+
+/**
+ * Retrieves registry from MC kernel.
+ *
+ * @author <a href="mailto:hbraun@redhat.com">Heiko Braun</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class DefaultEndpointRegistryFactory extends EndpointRegistryFactory
+{
+
+ private Logger log = Logger.getLogger(DefaultEndpointRegistryFactory.class);
+ /** The bean name in the kernel registry. */
+ private static final String BEAN_NAME = "WSEndpointRegistry";
+ private static final EndpointRegistry fallbackRegistry = new DefaultEndpointRegistry();;
+
+ /**
+ * Constructor.
+ */
+ public DefaultEndpointRegistryFactory()
+ {
+ super();
+ }
+
+ /**
+ * Returns endpoint registry registered in MC kernel.
+ *
+ * @return endpoint registry
+ */
+ public EndpointRegistry getEndpointRegistry()
+ {
+ try
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory = spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(DefaultEndpointRegistryFactory.BEAN_NAME, EndpointRegistry.class);
+ }
+ catch (WSFException e)
+ {
+ log.warn("Unable to get WSEndpointRegistry from IoC, using default one");
+ return fallbackRegistry; // JSE environment
+ }
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultJMSEndpointResolver.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultJMSEndpointResolver.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/DefaultJMSEndpointResolver.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.framework.management;
+
+/**
+ * Default resolver for JMS endpoints
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Mar-2010
+ * @Deprecated Use org.jboss.wsf.common.management.DefaultJMSEndpointResolver instead
+ */
+@Deprecated
+public class DefaultJMSEndpointResolver extends org.jboss.wsf.common.management.DefaultJMSEndpointResolver {}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/EndpointMetricsImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/EndpointMetricsImpl.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/EndpointMetricsImpl.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,170 @@
+/*
+ * 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.wsf.framework.management;
+
+import java.util.Date;
+
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+
+/**
+ * Service Endpoint Metrics
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Dec-2005
+ */
+public class EndpointMetricsImpl implements EndpointMetrics
+{
+ private Endpoint endpoint;
+
+ private Date startTime;
+ private Date stopTime;
+ private long requestCount;
+ private long responseCount;
+ private long faultCount;
+ private long maxProcessingTime;
+ private long minProcessingTime;
+ private long avgProcessingTime;
+ private long totalProcessingTime;
+
+ public Endpoint getEndpoint()
+ {
+ return endpoint;
+ }
+
+ public void setEndpoint(Endpoint endpoint)
+ {
+ this.endpoint = endpoint;
+ }
+
+ public void start()
+ {
+ startTime = new Date();
+ stopTime = null;
+ requestCount = 0;
+ responseCount = 0;
+ faultCount = 0;
+ maxProcessingTime = 0;
+ minProcessingTime = 0;
+ avgProcessingTime = 0;
+ totalProcessingTime = 0;
+ }
+
+ public void stop()
+ {
+ stopTime = new Date();
+ }
+
+ public long processRequestMessage()
+ {
+ requestCount++;
+ return System.currentTimeMillis();
+ }
+
+ public void processResponseMessage(long beginTime)
+ {
+ responseCount++;
+ processAnyMessage(beginTime);
+ }
+
+ public void processFaultMessage(long beginTime)
+ {
+ faultCount++;
+ processAnyMessage(beginTime);
+ }
+
+ private void processAnyMessage(long beginTime)
+ {
+ if (beginTime > 0)
+ {
+ long procTime = System.currentTimeMillis() - beginTime;
+
+ if (minProcessingTime == 0)
+ minProcessingTime = procTime;
+
+ maxProcessingTime = Math.max(maxProcessingTime, procTime);
+ minProcessingTime = Math.min(minProcessingTime, procTime);
+ totalProcessingTime = totalProcessingTime + procTime;
+ avgProcessingTime = totalProcessingTime / (responseCount + faultCount);
+ }
+ }
+
+ public Date getStartTime()
+ {
+ return startTime;
+ }
+
+ public Date getStopTime()
+ {
+ return stopTime;
+ }
+
+ public long getMinProcessingTime()
+ {
+ return minProcessingTime;
+ }
+
+ public long getMaxProcessingTime()
+ {
+ return maxProcessingTime;
+ }
+
+ public long getAverageProcessingTime()
+ {
+ return avgProcessingTime;
+ }
+
+ public long getTotalProcessingTime()
+ {
+ return totalProcessingTime;
+ }
+
+ public long getRequestCount()
+ {
+ return requestCount;
+ }
+
+ public long getFaultCount()
+ {
+ return faultCount;
+ }
+
+ public long getResponseCount()
+ {
+ return responseCount;
+ }
+
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder("\nEndpoint Metrics: " + endpoint.getName());
+ buffer.append("\n startTime=" + startTime);
+ buffer.append("\n stopTime=" + stopTime);
+ buffer.append("\n requestCount=" + requestCount);
+ buffer.append("\n responseCount=" + responseCount);
+ buffer.append("\n faultCount=" + faultCount);
+ buffer.append("\n maxProcessingTime=" + maxProcessingTime);
+ buffer.append("\n minProcessingTime=" + minProcessingTime);
+ buffer.append("\n avgProcessingTime=" + avgProcessingTime);
+ buffer.append("\n totalProcessingTime=" + totalProcessingTime);
+ return buffer.toString();
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,48 @@
+/*
+ * 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.wsf.framework.management;
+
+import javax.management.MBeanServer;
+
+/**
+ * Locate the single instance of the MBeanServer
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public final class MBeanServerLocator
+{
+
+ private final MBeanServer mbeanServer;
+
+ public MBeanServerLocator(final MBeanServer mbeanServer)
+ {
+ super();
+
+ this.mbeanServer = mbeanServer;
+ }
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,192 @@
+/*
+ * 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.wsf.framework.management;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.framework.management.recording.ManagedRecordProcessor;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * The endpoint MBean representation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 20-Jun-2007
+ */
+public class ManagedEndpoint implements ManagedEndpointMBean
+{
+ private Endpoint endpoint;
+ private MBeanServer mbeanServer;
+ private Logger log = Logger.getLogger(this.getClass());
+
+ public ManagedEndpoint(Endpoint endpoint, MBeanServer mbeanServer)
+ {
+ this.endpoint = endpoint;
+ this.mbeanServer = mbeanServer;
+ }
+
+ public String getAddress()
+ {
+ return endpoint.getAddress();
+ }
+
+ public long getAverageProcessingTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getAverageProcessingTime() : 0;
+ }
+
+ public long getFaultCount()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getFaultCount() : 0;
+ }
+
+ public long getMaxProcessingTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getMaxProcessingTime() : 0;
+ }
+
+ public long getMinProcessingTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getMinProcessingTime() : 0;
+ }
+
+ public long getRequestCount()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getRequestCount() : 0;
+ }
+
+ public long getResponseCount()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getResponseCount() : 0;
+ }
+
+ public Date getStartTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getStartTime() : null;
+ }
+
+ public Date getStopTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getStopTime() : null;
+ }
+
+ public long getTotalProcessingTime()
+ {
+ EndpointMetrics metrics = endpoint.getEndpointMetrics();
+ return metrics != null ? metrics.getTotalProcessingTime() : 0;
+ }
+
+ public void start()
+ {
+ endpoint.getLifecycleHandler().start(endpoint);
+ }
+
+ public void stop()
+ {
+ endpoint.getLifecycleHandler().stop(endpoint);
+ }
+
+ public void processRecord(Record record)
+ {
+ endpoint.processRecord(record);
+ }
+
+ public void addRecordProcessor(RecordProcessor processor)
+ {
+ this.getRecordProcessors().add(processor);
+ try
+ {
+ mbeanServer.registerMBean(processor, ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.debug("Cannot register endpoint with JMX server, trying with the default ManagedRecordProcessor: " + ex.getMessage());
+ try
+ {
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor), ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException innerEx)
+ {
+ log.error("Cannot register endpoint with JMX server", innerEx);
+ }
+ }
+ }
+
+ public List<RecordProcessor> getRecordProcessors()
+ {
+ return endpoint.getRecordProcessors();
+ }
+
+ public void setRecordProcessors(List<RecordProcessor> processors)
+ {
+ //unregister current processors
+ for (RecordProcessor processor : processors)
+ {
+ try
+ {
+ mbeanServer.unregisterMBean(ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot unregister record processor with JMX server", ex);
+ }
+ }
+ //set and register the new processors
+ endpoint.setRecordProcessors(processors);
+ for (RecordProcessor processor : processors)
+ {
+ try
+ {
+ mbeanServer.registerMBean(processor, ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException ex)
+ {
+ log.debug("Cannot register endpoint with JMX server, trying with the default ManagedRecordProcessor: " + ex.getMessage());
+ try
+ {
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor), ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" + processor.getName()));
+ }
+ catch (JMException innerEx)
+ {
+ log.error("Cannot register endpoint with JMX server", innerEx);
+ }
+ }
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,68 @@
+/*
+ * 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.wsf.framework.management;
+
+import java.util.Date;
+import java.util.List;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ManagedEndpointMBean
+{
+ void start();
+
+ void stop();
+
+ String getAddress();
+
+ Date getStartTime();
+
+ Date getStopTime();
+
+ long getMinProcessingTime();
+
+ long getMaxProcessingTime();
+
+ long getAverageProcessingTime();
+
+ long getTotalProcessingTime();
+
+ long getRequestCount();
+
+ long getFaultCount();
+
+ long getResponseCount();
+
+ void processRecord(Record record);
+
+ void addRecordProcessor(RecordProcessor processor);
+
+ List<RecordProcessor> getRecordProcessors();
+
+ void setRecordProcessors(List<RecordProcessor> processors);
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,103 @@
+/*
+ * 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.wsf.framework.management;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+/**
+ * A Service Endpoint Registry
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-May-2007
+ */
+public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
+
+ // The MBeanServer
+ private MBeanServer mbeanServer;
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ @Override
+ public void register(Endpoint endpoint)
+ {
+ super.register(endpoint);
+
+ try
+ {
+ ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint, mbeanServer);
+ getMbeanServer().registerMBean(jmxEndpoint, endpoint.getName());
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot register endpoint with JMX server", ex);
+ }
+ }
+
+ @Override
+ public void unregister(Endpoint endpoint)
+ {
+ super.unregister(endpoint);
+ try
+ {
+ if (getMbeanServer() != null)
+ getMbeanServer().unregisterMBean(endpoint.getName());
+ else
+ log.warn("MBeanServer not available, cannot unregister endpoint with JMX server");
+ }
+ catch (JMException ex)
+ {
+ log.error("Cannot unregister endpoint with JMX server", ex);
+ }
+ }
+
+ public void create() throws Exception
+ {
+ if (mbeanServer != null)
+ {
+ getMbeanServer().registerMBean(this, OBJECT_NAME);
+ }
+ }
+
+ public void destroy() throws Exception
+ {
+ log.debug("Destroy service endpoint manager");
+ if (mbeanServer != null)
+ {
+ getMbeanServer().unregisterMBean(OBJECT_NAME);
+ }
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,37 @@
+/*
+ * 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.wsf.framework.management;
+
+import javax.management.ObjectName;
+
+import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ManagedEndpointRegistryMBean extends EndpointRegistry
+{
+ /** The object name in the MBean server */
+ ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=EndpointRegistry");
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AbstractRecordProcessor.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,195 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import java.util.List;
+import java.util.Vector;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * An abstract record processor providing basic implementation
+ * of the processor configuration and filter's management
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public abstract class AbstractRecordProcessor implements RecordProcessor
+{
+ protected List<RecordFilter> filters = new Vector<RecordFilter>();
+ protected boolean processDestinationHost = true;
+ protected boolean processSourceHost = true;
+ protected boolean processHeaders = true;
+ protected boolean processEnvelope = true;
+ protected boolean processMessageType = true;
+ protected boolean processOperation = true;
+ protected boolean processDate = true;
+ protected String name;
+ protected boolean recording = false;
+
+ public abstract void processRecord(Record record);
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void addFilter(RecordFilter filter)
+ {
+ filters.add(filter);
+ }
+
+ public List<RecordFilter> getFilters()
+ {
+ return filters;
+ }
+
+ public void setFilters(List<RecordFilter> filters)
+ {
+ this.filters = new Vector<RecordFilter>(filters);
+ }
+
+ public boolean isProcessDestinationHost()
+ {
+ return processDestinationHost;
+ }
+
+ public void setProcessDestinationHost(boolean processDestinationHost)
+ {
+ this.processDestinationHost = processDestinationHost;
+ }
+
+ public boolean isProcessSourceHost()
+ {
+ return processSourceHost;
+ }
+
+ public void setProcessSourceHost(boolean processSourceHost)
+ {
+ this.processSourceHost = processSourceHost;
+ }
+
+ public boolean isProcessHeaders()
+ {
+ return processHeaders;
+ }
+
+ public void setProcessHeaders(boolean processHeaders)
+ {
+ this.processHeaders = processHeaders;
+ }
+
+ public boolean isProcessEnvelope()
+ {
+ return processEnvelope;
+ }
+
+ public void setProcessEnvelope(boolean processEnvelope)
+ {
+ this.processEnvelope = processEnvelope;
+ }
+
+ public boolean isProcessMessageType()
+ {
+ return processMessageType;
+ }
+
+ public void setProcessMessageType(boolean processMessageType)
+ {
+ this.processMessageType = processMessageType;
+ }
+
+ public boolean isProcessOperation()
+ {
+ return processOperation;
+ }
+
+ public void setProcessOperation(boolean processOperation)
+ {
+ this.processOperation = processOperation;
+ }
+
+ public boolean isProcessDate()
+ {
+ return processDate;
+ }
+
+ public void setProcessDate(boolean processDate)
+ {
+ this.processDate = processDate;
+ }
+
+ public boolean isRecording()
+ {
+ return recording;
+ }
+
+ public void setRecording(boolean recording)
+ {
+ this.recording = recording;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException
+ {
+ AbstractRecordProcessor retObj = (AbstractRecordProcessor)super.clone();
+ retObj.filters = new Vector<RecordFilter>();
+ for (RecordFilter fil : this.filters)
+ {
+ RecordFilter clFil = (RecordFilter)fil.clone();
+ retObj.filters.add(clFil);
+ }
+ retObj.processDestinationHost = this.processDestinationHost;
+ retObj.processSourceHost = this.processSourceHost;
+ retObj.processHeaders = this.processHeaders;
+ retObj.processEnvelope = this.processEnvelope;
+ retObj.processMessageType = this.processMessageType;
+ retObj.processOperation = this.processOperation;
+ retObj.processDate = this.processDate;
+ retObj.recording = this.recording;
+ retObj.name = this.name;
+ return retObj;
+ }
+
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append(super.toString());
+ sb.append(" (recording = " + recording);
+ sb.append(", processDestinationHost = " + processDestinationHost);
+ sb.append(", processSourceHost = " + processSourceHost);
+ sb.append(", processHeaders = " + processHeaders);
+ sb.append(", processEnvelope = " + processEnvelope);
+ sb.append(", processMessageType = " + processMessageType);
+ sb.append(", processOperation = " + processOperation);
+ sb.append(", processDate = " + processDate);
+ sb.append(")");
+ return sb.toString();
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/AndFilter.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,70 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the AND operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class AndFilter implements RecordFilter
+{
+ private static final long serialVersionUID = -7535769052173597426L;
+
+ private RecordFilter filter1;
+ private RecordFilter filter2;
+
+ public AndFilter(RecordFilter filter1, RecordFilter filter2)
+ {
+ this.filter1 = filter1;
+ this.filter2 = filter2;
+ }
+
+ public boolean match(Record record)
+ {
+ return filter1.match(record) && filter2.match(record);
+ }
+
+ public RecordFilter getFilter1()
+ {
+ return filter1;
+ }
+
+ public RecordFilter getFilter2()
+ {
+ return filter2;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException
+ {
+ AndFilter retObj = (AndFilter)super.clone();
+ retObj.filter1 = (RecordFilter)this.filter1.clone();
+ retObj.filter2 = (RecordFilter)this.filter2.clone();
+ return retObj;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/HostFilter.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,87 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * This filter matches records having the source/destination host equal to
+ * any of the provided hosts.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 11-Dec-2007
+ */
+public class HostFilter implements RecordFilter
+{
+ private static final long serialVersionUID = -5935962601380315102L;
+
+ private List<String> hosts = new LinkedList<String>();
+ private boolean source;
+
+ public HostFilter(String host, boolean source)
+ {
+ this.hosts.add(host);
+ this.source = source;
+ }
+
+ public HostFilter(Collection<String> hosts, boolean source)
+ {
+ this.hosts.addAll(hosts);
+ this.source = source;
+ }
+
+ public boolean match(Record record)
+ {
+ for (String host : hosts)
+ {
+ if ((source && host.equalsIgnoreCase(record.getSourceHost())) || (!source && host.equalsIgnoreCase(record.getDestinationHost())))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public List<String> getHosts()
+ {
+ return hosts;
+ }
+
+ public boolean isSource()
+ {
+ return source;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException
+ {
+ HostFilter retObj = (HostFilter)super.clone();
+ retObj.hosts = new LinkedList<String>(this.hosts);
+ retObj.source = this.source;
+ return retObj;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/LogRecorder.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,129 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.Record.MessageType;
+
+/**
+ * A simple record processor that writes records to the configured log.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class LogRecorder extends AbstractRecordProcessor implements Serializable
+{
+ private static final long serialVersionUID = -7126227194320867819L;
+
+ private Logger log = Logger.getLogger(this.getClass());
+
+ public LogRecorder()
+ {
+ this.name = "LogRecorder";
+ }
+
+ @Override
+ public void processRecord(Record record)
+ {
+ StringBuilder sb = new StringBuilder();
+ if (this.isProcessMessageType())
+ {
+ if (record.getMessageType() == MessageType.INBOUND)
+ {
+ sb.append("INBOUND MESSAGE ");
+ if (this.isProcessSourceHost() && record.getSourceHost() != null)
+ {
+ sb.append("from ");
+ sb.append(record.getSourceHost());
+ }
+ }
+ else if (record.getMessageType() == MessageType.OUTBOUND)
+ {
+ sb.append("OUTBOUND MESSAGE ");
+ if (this.isProcessDestinationHost() && record.getDestinationHost() != null)
+ {
+ sb.append("to ");
+ sb.append(record.getDestinationHost());
+ }
+ }
+ else
+ {
+ log.warn("Unknown message type: " + record.getMessageType());
+ if (this.isProcessSourceHost() && record.getSourceHost() != null)
+ {
+ sb.append("from ");
+ sb.append(record.getSourceHost());
+ }
+ if (this.isProcessDestinationHost() && record.getDestinationHost() != null)
+ {
+ sb.append("to ");
+ sb.append(record.getDestinationHost());
+ }
+ }
+ }
+ else
+ {
+ sb.append("MESSAGE");
+ }
+ sb.append(":");
+ if (this.isProcessDate())
+ {
+ sb.append("\nDate: ");
+ sb.append(record.getDate());
+ }
+ sb.append("\nGroupID: ");
+ sb.append(record.getGroupID());
+ if (this.isProcessOperation())
+ {
+ sb.append("\nOperation: ");
+ sb.append(record.getOperation());
+ }
+ sb.append("\n");
+ Map<String, List<String>> headers = record.getHeaders();
+ if (this.isProcessHeaders() && headers != null)
+ {
+ for (String key : headers.keySet())
+ {
+ sb.append(key);
+ sb.append(": ");
+ for (String h : headers.get(key))
+ {
+ sb.append(h);
+ sb.append("; ");
+ }
+ sb.append("\n");
+ }
+ sb.append("\n");
+ }
+ sb.append("\n");
+ if (this.isProcessEnvelope())
+ {
+ sb.append(record.getEnvelope());
+ }
+ log.debug(sb.toString());
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessor.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,144 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import java.util.List;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+import org.jboss.wsf.spi.management.recording.RecordProcessor;
+
+/**
+ * The record processor MBean representation
+ *
+ * @author alessio.soldano(a)jboss.org
+ * @since 12-Dec-2007
+ */
+public class ManagedRecordProcessor implements ManagedRecordProcessorMBean
+{
+ private RecordProcessor processor;
+
+ public ManagedRecordProcessor(RecordProcessor processor)
+ {
+ this.processor = processor;
+ }
+
+ public void addFilter(RecordFilter filter)
+ {
+ processor.addFilter(filter);
+ }
+
+ public List<RecordFilter> getFilters()
+ {
+ return processor.getFilters();
+ }
+
+ public boolean isProcessDate()
+ {
+ return processor.isProcessDate();
+ }
+
+ public boolean isProcessDestinationHost()
+ {
+ return processor.isProcessDestinationHost();
+ }
+
+ public boolean isProcessHeaders()
+ {
+ return processor.isProcessHeaders();
+ }
+
+ public boolean isProcessEnvelope()
+ {
+ return processor.isProcessEnvelope();
+ }
+
+ public boolean isProcessMessageType()
+ {
+ return processor.isProcessMessageType();
+ }
+
+ public boolean isProcessOperation()
+ {
+ return processor.isProcessOperation();
+ }
+
+ public boolean isProcessSourceHost()
+ {
+ return processor.isProcessSourceHost();
+ }
+
+ public void processRecord(Record record)
+ {
+ processor.processRecord(record);
+ }
+
+ public void setFilters(List<RecordFilter> filters)
+ {
+ processor.setFilters(filters);
+ }
+
+ public void setProcessDate(boolean value)
+ {
+ processor.setProcessDate(value);
+ }
+
+ public void setProcessDestinationHost(boolean value)
+ {
+ processor.setProcessDestinationHost(value);
+ }
+
+ public void setProcessHeaders(boolean value)
+ {
+ processor.setProcessHeaders(value);
+ }
+
+ public void setProcessEnvelope(boolean value)
+ {
+ processor.setProcessEnvelope(value);
+ }
+
+ public void setProcessMessageType(boolean value)
+ {
+ processor.setProcessMessageType(value);
+ }
+
+ public void setProcessOperation(boolean value)
+ {
+ processor.setProcessOperation(value);
+ }
+
+ public void setProcessSourceHost(boolean value)
+ {
+ processor.setProcessSourceHost(value);
+ }
+
+ public boolean isRecording()
+ {
+ return processor.isRecording();
+ }
+
+ public void setRecording(boolean value)
+ {
+ processor.setRecording(value);
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/ManagedRecordProcessorMBean.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,76 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import java.util.List;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * The record processor MBean interface
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Dec-2007
+ */
+public interface ManagedRecordProcessorMBean
+{
+ public void processRecord(Record record);
+
+ public void setRecording(boolean value);
+
+ public boolean isRecording();
+
+ public List<RecordFilter> getFilters();
+
+ public void addFilter(RecordFilter filter);
+
+ public void setFilters(List<RecordFilter> filters);
+
+ public boolean isProcessSourceHost();
+
+ public void setProcessSourceHost(boolean value);
+
+ public boolean isProcessDestinationHost();
+
+ public void setProcessDestinationHost(boolean value);
+
+ public boolean isProcessMessageType();
+
+ public void setProcessMessageType(boolean value);
+
+ public boolean isProcessEnvelope();
+
+ public void setProcessEnvelope(boolean value);
+
+ public boolean isProcessHeaders();
+
+ public void setProcessHeaders(boolean value);
+
+ public boolean isProcessOperation();
+
+ public void setProcessOperation(boolean value);
+
+ public boolean isProcessDate();
+
+ public void setProcessDate(boolean value);
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,294 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+import org.jboss.wsf.spi.management.recording.Record.MessageType;
+
+/**
+ * Keeps the last received records in memory and allows user to
+ * search / get statistics on them.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-Dec-2007
+ */
+public class MemoryBufferRecorder extends AbstractRecordProcessor implements MemoryBufferRecorderMBean, Serializable
+{
+ private static final long serialVersionUID = 5180978625780333738L;
+
+ private Map<String, List<Record>> recentRecords = Collections.synchronizedMap(new HashMap<String, List<Record>>());
+ private ConcurrentLinkedQueue<String> recentRecordGroups = new ConcurrentLinkedQueue<String>();
+ private int size = 0;
+ private int maxSize = 50;
+
+ public MemoryBufferRecorder()
+ {
+ this.name = "MemoryBufferRecorder";
+ }
+
+ @Override
+ public void processRecord(Record record)
+ {
+ synchronized (recentRecords)
+ {
+ List<Record> list = recentRecords.get(record.getGroupID());
+ if (list == null)
+ {
+ list = new LinkedList<Record>();
+ recentRecords.put(record.getGroupID(), list);
+ while (size > maxSize)
+ {
+ this.deleteOldestRecord();
+ }
+ recentRecordGroups.offer(record.getGroupID());
+ size++;
+ }
+ list.add(record);
+ }
+ }
+
+
+ private void deleteOldestRecord()
+ {
+ String id = recentRecordGroups.poll();
+ if (id != null)
+ {
+ recentRecords.remove(id);
+ size--;
+ }
+ }
+
+ private Map<String, List<Record>> getRecentRecords()
+ {
+ synchronized (recentRecords)
+ {
+ return new HashMap<String, List<Record>>(recentRecords);
+ }
+ }
+
+ public Set<String> getClientHosts()
+ {
+ Map<String, List<Record>> map = this.getRecentRecords();
+ Set<String> hosts = new HashSet<String>();
+ for (List<Record> list : map.values())
+ {
+ for (Record record : list)
+ {
+ if (MessageType.INBOUND.equals(record.getMessageType()) && record.getSourceHost() != null)
+ {
+ hosts.add(record.getSourceHost());
+ }
+ }
+ }
+ return hosts;
+ }
+
+ public Map<String, List<Record>> getMatchingRecords(RecordFilter[] filters)
+ {
+ Map<String, List<Record>> map = this.getRecentRecords();
+ Map<String, List<Record>> result = new HashMap<String, List<Record>>();
+ for (List<Record> list : map.values())
+ {
+ for (Record record : list)
+ {
+ boolean match = true;
+ for (int i = 0; i < filters.length && match; i++)
+ {
+ match = match && filters[i].match(record);
+ }
+ if (match)
+ {
+ result.put(record.getGroupID(), list);
+ break;
+ }
+ }
+ }
+ return result;
+ }
+
+ public Map<String, List<Record>> getRecordsByClientHost(String clientHost)
+ {
+ RecordFilter[] filters = new RecordFilter[1];
+ filters[0] = new HostFilter(clientHost, true);
+ return this.getMatchingRecords(filters);
+ }
+
+ public String getRecordsByClientHostAsHTMLTable(boolean groupRecords, boolean showDetails, String clientHost)
+ {
+ return toHtml(groupRecords, showDetails, this.getRecordsByClientHost(clientHost));
+ }
+
+ public Map<String, List<Record>> getRecordsByOperation(String namespace, String localPart)
+ {
+ RecordFilter[] filters = new RecordFilter[1];
+ filters[0] = new OperationFilter(new QName(namespace, localPart));
+ return this.getMatchingRecords(filters);
+ }
+
+ public String getRecordsByOperationAsHTMLTable(boolean groupRecords, boolean showDetails, String namespace, String localPart)
+ {
+ return toHtml(groupRecords, showDetails, this.getRecordsByOperation(namespace, localPart));
+ }
+
+ public int getMaxSize()
+ {
+ return maxSize;
+ }
+
+ public void setMaxSize(int maxSize)
+ {
+ synchronized (recentRecords)
+ {
+ while (maxSize < size)
+ {
+ this.deleteOldestRecord();
+ }
+ this.maxSize = maxSize;
+ }
+ }
+
+ public int getSize()
+ {
+ return size;
+ }
+
+ public String getRecordsAsHTMLTable(boolean groupRecords, boolean showDetails)
+ {
+ Map<String,List<Record>> records = this.getRecentRecords();
+ return toHtml(groupRecords, showDetails, records);
+ }
+
+ private String toHtml(boolean groupRecords, boolean showDetails, Map<String, List<Record>> records)
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("</pre></span>");
+ if (!groupRecords)
+ openTable(sb, showDetails);
+ for (String key : records.keySet())
+ {
+ if (groupRecords)
+ openTable(sb, showDetails);
+ for (Record record : records.get(key))
+ {
+ appendRecordRow(sb, record, showDetails);
+ }
+ if (groupRecords)
+ closeTable(sb);
+ }
+ if (!groupRecords)
+ closeTable(sb);
+ sb.append("<pre><span class='OpResult'>");
+ return sb.toString();
+ }
+
+ private void openTable(StringBuilder sb, boolean showDetails)
+ {
+ sb.append("<table border='1'><tr class='AttributesHeader'><th>Group ID</th><th>Type</th><th>Date</th><th>From</th><th>To</th><th>Operation</th>");
+ if (showDetails)
+ sb.append("<th>Headers</th><th>Envelope</th>");
+ sb.append("</tr><tr>");
+ }
+
+ private void closeTable(StringBuilder sb)
+ {
+ sb.append("</tr></table><br />");
+ }
+
+ private void appendRecordRow(StringBuilder sb, Record record, boolean showDetails) {
+ sb.append("<tr><td><pre>");
+ sb.append(record.getGroupID() != null ? record.getGroupID() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getMessageType() != null ? record.getMessageType() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getDate() != null ? record.getDate() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getSourceHost() != null ? record.getSourceHost() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getDestinationHost() != null ? record.getDestinationHost() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getOperation() != null ? record.getOperation() : "[Not available]");
+ sb.append("</pre></td>");
+ if (showDetails)
+ {
+ sb.append("<td><pre>");
+ if (record.getHeaders() != null)
+ {
+ for (String headerName : record.getHeaders().keySet())
+ {
+ sb.append(headerName);
+ sb.append(": ");
+ sb.append(record.getHeaders().get(headerName));
+ sb.append("<br />");
+ }
+ }
+ else
+ sb.append("[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getEnvelope() != null ? record.getEnvelope().replaceAll("<", "<").replaceAll(">", ">") : "[Not available]");
+ sb.append("</pre></td>");
+ }
+ sb.append("</tr>");
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException
+ {
+ MemoryBufferRecorder cl = (MemoryBufferRecorder)super.clone();
+ cl.recentRecords = Collections.synchronizedMap(new HashMap<String, List<Record>>());
+ for (String key : this.recentRecords.keySet())
+ {
+ List<Record> list = new LinkedList<Record>();
+ for (Record record : this.recentRecords.get(key))
+ {
+ list.add(record);
+ }
+ cl.recentRecords.put(key, list);
+ }
+ cl.recentRecordGroups = new ConcurrentLinkedQueue<String>();
+ for (String id : this.recentRecordGroups)
+ {
+ cl.recentRecordGroups.add(id);
+ }
+ cl.maxSize = this.maxSize;
+ cl.size = this.size;
+ return cl;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,118 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * The MemoryBufferRecorder's MBean view
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ */
+public interface MemoryBufferRecorderMBean extends ManagedRecordProcessorMBean
+{
+ /**
+ * Gets the records matching the provided filters. Records having the
+ * same group ID are returned together.
+ *
+ * @param filters
+ * @return The matching records as a map GroupID->List<Record>
+ */
+ public Map<String, List<Record>> getMatchingRecords(RecordFilter[] filters);
+
+ /**
+ * Gets the records with the given operation. Records having the
+ * same group ID are returned together.
+ *
+ * @param namespace
+ * @param localPart
+ * @return The matching records as a map GroupID->List<Record>
+ */
+ public Map<String, List<Record>> getRecordsByOperation(String namespace, String localPart);
+
+ /**
+ * Gets the records with the given client host. Records having the
+ * same group ID are returned together.
+ *
+ * @param clientHost
+ * @return The matching records as a map GroupID->List<Record>
+ */
+ public Map<String, List<Record>> getRecordsByClientHost(String clientHost);
+
+ /**
+ * Gets a set containing the client hosts of the last saved records.
+ *
+ * @return
+ */
+ public Set<String> getClientHosts();
+
+ /**
+ * Gets the current buffer max size (i.e. the number of record groups stored at the same time)
+ *
+ * @return
+ */
+ public int getMaxSize();
+
+ public void setMaxSize(int maxSize);
+
+ /**
+ * Gets the buffer's current size
+ * @return
+ */
+ public int getSize();
+
+ /**
+ * Shows all the records as a HTML table
+ *
+ * @param groupRecords whether the records should be grouped using the group ID
+ * @param showDetails whether to show headers and envelopes
+ * @return
+ */
+ public String getRecordsAsHTMLTable(boolean groupRecords, boolean showDetails);
+
+ /**
+ * Shows the records with the given client host as a HTML table.
+ *
+ * @param groupRecords
+ * @param showDetails
+ * @param clientHost
+ * @return
+ */
+ public String getRecordsByClientHostAsHTMLTable(boolean groupRecords, boolean showDetails, String clientHost);
+
+ /**
+ * Shows the records with the given operation as a HTML table.
+ *
+ * @param groupRecords
+ * @param showDetails
+ * @param namespace
+ * @param localPart
+ * @return
+ */
+ public String getRecordsByOperationAsHTMLTable(boolean groupRecords, boolean showDetails, String namespace, String localPart);
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/NotFilter.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,62 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the negation operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class NotFilter implements RecordFilter
+{
+ private static final long serialVersionUID = -3254118688017137981L;
+
+ private RecordFilter filter;
+
+ public NotFilter(RecordFilter filter)
+ {
+ this.filter = filter;
+ }
+
+ public boolean match(Record record)
+ {
+ return !filter.match(record);
+ }
+
+ public RecordFilter getFilter()
+ {
+ return filter;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException
+ {
+ NotFilter retObj = (NotFilter)super.clone();
+ retObj.filter = (RecordFilter)this.filter.clone();
+ return retObj;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OperationFilter.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,81 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * This filter matches records having a given operation QName value.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 11-Dec-2007
+ */
+public class OperationFilter implements RecordFilter
+{
+ private static final long serialVersionUID = -726794729964445956L;
+
+ private QName operation;
+
+ public OperationFilter(QName operation)
+ {
+ this.operation = operation;
+ }
+
+ public boolean match(Record record)
+ {
+ if (record != null)
+ {
+ if (record.getOperation() == null && operation == null)
+ {
+ return true;
+ }
+ else if (operation != null && operation.equals(record.getOperation()))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ public QName getOperation()
+ {
+ return operation;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException
+ {
+ OperationFilter retObj = (OperationFilter)super.clone();
+ retObj.operation = this.operation;
+ return retObj;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/OrFilter.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,70 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import org.jboss.wsf.spi.management.recording.Record;
+import org.jboss.wsf.spi.management.recording.RecordFilter;
+
+/**
+ * A simple record filter acting like the OR operator
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Dec-2007
+ *
+ */
+public class OrFilter implements RecordFilter
+{
+ private static final long serialVersionUID = 3372989051076281559L;
+
+ private RecordFilter filter1;
+ private RecordFilter filter2;
+
+ public OrFilter(RecordFilter filter1, RecordFilter filter2)
+ {
+ this.filter1 = filter1;
+ this.filter2 = filter2;
+ }
+
+ public boolean match(Record record)
+ {
+ return filter1.match(record) || filter2.match(record);
+ }
+
+ public RecordFilter getFilter1()
+ {
+ return filter1;
+ }
+
+ public RecordFilter getFilter2()
+ {
+ return filter2;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException
+ {
+ OrFilter retObj = (OrFilter)super.clone();
+ retObj.filter1 = (RecordFilter)this.filter1.clone();
+ retObj.filter2 = (RecordFilter)this.filter2.clone();
+ return retObj;
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,61 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import org.jboss.wsf.spi.management.recording.Record;
+
+/**
+ * Simple record factory
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class RecordFactory
+{
+ private static long count = 0;
+
+ public static String newGroupID()
+ {
+ long time = System.currentTimeMillis();
+ StringBuilder sb = new StringBuilder();
+ synchronized (RecordFactory.class)
+ {
+ count++;
+ }
+ sb.append(count);
+ sb.append("-");
+ sb.append(time);
+ return sb.toString();
+ }
+
+ public static Record newRecord(String groupID)
+ {
+ Record record = new RecordImpl();
+ record.setGroupID(groupID);
+ return record;
+ }
+
+ public static Record newRecord()
+ {
+ return newRecord(newGroupID());
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/management/recording/RecordImpl.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,143 @@
+/*
+ * 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.wsf.framework.management.recording;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.wsf.spi.management.recording.Record;
+
+/**
+ * Default Record implementation
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 8-Dec-2007
+ */
+public class RecordImpl implements Record
+{
+ private static final long serialVersionUID = -2421022916458208468L;
+
+ private String sourceHost;
+ private String destinationHost;
+ private Map<String, List<String>> headers = new HashMap<String, List<String>>();
+ private MessageType messageType;
+ private QName operation;
+ private String groupID;
+ private Date date;
+ private String envelope;
+
+ RecordImpl()
+ {
+
+ }
+
+ public void addHeaders(String key, List<String> value)
+ {
+ headers.put(key, value);
+ }
+
+ public Map<String, List<String>> getHeaders()
+ {
+ return headers;
+ }
+
+ public MessageType getMessageType()
+ {
+ return messageType;
+ }
+
+ public void setMessageType(MessageType messageType)
+ {
+ this.messageType = messageType;
+ }
+
+ public String getSourceHost()
+ {
+ return sourceHost;
+ }
+
+ public void setSourceHost(String sourceHost)
+ {
+ this.sourceHost = sourceHost;
+ }
+
+ public String getDestinationHost()
+ {
+ return destinationHost;
+ }
+
+ public void setDestinationHost(String destinationHost)
+ {
+ this.destinationHost = destinationHost;
+ }
+
+ public void setHeaders(Map<String, List<String>> headers)
+ {
+ if (headers != null)
+ this.headers = new HashMap<String, List<String>>(headers);
+ }
+
+ public String getGroupID()
+ {
+ return groupID;
+ }
+
+ public QName getOperation()
+ {
+ return operation;
+ }
+
+ public void setGroupID(String groupID)
+ {
+ this.groupID = groupID;
+ }
+
+ public void setOperation(QName operation)
+ {
+ this.operation = operation;
+ }
+
+ public Date getDate()
+ {
+ return date;
+ }
+
+ public void setDate(Date date)
+ {
+ this.date = date;
+ }
+
+ public void setEnvelope(String envelope)
+ {
+ this.envelope = envelope;
+ }
+
+ public String getEnvelope()
+ {
+ return envelope;
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/security/DefaultSecurityAdapterFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/security/DefaultSecurityAdapterFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/security/DefaultSecurityAdapterFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.wsf.framework.security;
+
+import java.security.Principal;
+
+import javax.security.auth.Subject;
+
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+
+/**
+ * TODO: javadoc
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class DefaultSecurityAdapterFactory extends SecurityAdaptorFactory
+{
+
+ private static SecurityAdaptor SECURITY_ADAPTOR = new DefaultSecurityAdaptor();
+
+ /**
+ * Constructor.
+ */
+ public DefaultSecurityAdapterFactory()
+ {
+ super();
+ }
+
+ /**
+ * Creates new security adapter instance.
+ *
+ * @return security adapter
+ */
+ public SecurityAdaptor newSecurityAdapter()
+ {
+ return DefaultSecurityAdapterFactory.SECURITY_ADAPTOR;
+ }
+
+ private static class DefaultSecurityAdaptor implements SecurityAdaptor
+ {
+
+ private static ThreadLocal<Principal> principal = new ThreadLocal<Principal>();
+ private static ThreadLocal<Object> credential = new ThreadLocal<Object>();
+
+ public Object getCredential()
+ {
+ return DefaultSecurityAdaptor.credential.get();
+ }
+
+ public Principal getPrincipal()
+ {
+ return DefaultSecurityAdaptor.principal.get();
+ }
+
+ public void pushSubjectContext(Subject subject, Principal principal, Object credential)
+ {
+ // does nothing
+ }
+
+ public void setCredential(Object credential)
+ {
+ DefaultSecurityAdaptor.credential.set(credential);
+ }
+
+ public void setPrincipal(Principal principal)
+ {
+ DefaultSecurityAdaptor.principal.set(principal);
+ }
+
+ }
+
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandler.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandler.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandler.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,62 @@
+/*
+ * 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.wsf.framework.serviceref;
+
+import javax.naming.Referenceable;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
+import org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
+
+/**
+ * Binds service refs to the client's ENC.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class DefaultServiceRefHandler implements ServiceRefHandler
+{
+ @Override
+ public Referenceable createReferenceable(final UnifiedServiceRefMetaData serviceRefMD)
+ {
+ if (serviceRefMD.getVfsRoot() == null)
+ {
+ throw new IllegalStateException("VFSRoot must be provided");
+ }
+ if (serviceRefMD.getType() == null)
+ {
+ throw new IllegalStateException("Service reference type must be provided");
+ }
+
+ return this.getBinder(serviceRefMD.getType()).createReferenceable(serviceRefMD);
+ }
+
+ private ServiceRefBinder getBinder(final Type type)
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final ServiceRefBinderFactory serviceRefBindingFactory = spiProvider.getSPI(ServiceRefBinderFactory.class);
+
+ return serviceRefBindingFactory.newServiceRefBinder(type);
+ }
+}
Added: common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandlerFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandlerFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/framework/serviceref/DefaultServiceRefHandlerFactory.java 2011-01-11 16:08:33 UTC (rev 13555)
@@ -0,0 +1,39 @@
+/*
+ * 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.wsf.framework.serviceref;
+
+import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
+
+/**
+ * A factory for the ServiceRefHandler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2004
+ */
+public class DefaultServiceRefHandlerFactory implements ServiceRefHandlerFactory
+{
+ public ServiceRefHandler getServiceRefHandler()
+ {
+ return new DefaultServiceRefHandler();
+ }
+}
13 years, 11 months
JBossWS SVN: r13554 - in framework/trunk/src/main: scripts and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 11:06:46 -0500 (Tue, 11 Jan 2011)
New Revision: 13554
Removed:
framework/trunk/src/main/java/
framework/trunk/src/main/scripts/assembly-resources.xml
Log:
refactoring framework sources to common
Deleted: framework/trunk/src/main/scripts/assembly-resources.xml
===================================================================
--- framework/trunk/src/main/scripts/assembly-resources.xml 2011-01-11 14:20:09 UTC (rev 13553)
+++ framework/trunk/src/main/scripts/assembly-resources.xml 2011-01-11 16:06:46 UTC (rev 13554)
@@ -1,18 +0,0 @@
-<assembly 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/xsd/assembly-1.1.0-SNAPSHOT.xsd">
- <id>scripts</id>
- <formats>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>src/main/etc</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>*.bat</include>
- <include>*.sh</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
13 years, 11 months
JBossWS SVN: r13553 - in stack/native/trunk: modules/core and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 09:20:09 -0500 (Tue, 11 Jan 2011)
New Revision: 13553
Modified:
stack/native/trunk/modules/core/pom.xml
stack/native/trunk/modules/management/pom.xml
stack/native/trunk/pom.xml
stack/native/trunk/src/main/distro/build-deploy.xml
stack/native/trunk/src/main/scripts/assembly-deploy-artifacts.xml
Log:
use created ASIL for jboss 600 Final
Modified: stack/native/trunk/modules/core/pom.xml
===================================================================
--- stack/native/trunk/modules/core/pom.xml 2011-01-11 14:19:31 UTC (rev 13552)
+++ stack/native/trunk/modules/core/pom.xml 2011-01-11 14:20:09 UTC (rev 13553)
@@ -196,6 +196,25 @@
</artifactItems>
</configuration>
</execution>
+ <execution>
+ <id>copy-dependencies</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>org.jboss.ws:jbossws-jboss*:zip:resources</artifactItems>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-jboss600</artifactId>
+ <version>${jbossws.jboss600.version}</version>
+ <classifier>resources</classifier>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}/resources/jbossws-jboss600</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
<!-- [JBWS-2505] -->
<!-- START -->
<!--
Modified: stack/native/trunk/modules/management/pom.xml
===================================================================
--- stack/native/trunk/modules/management/pom.xml 2011-01-11 14:19:31 UTC (rev 13552)
+++ stack/native/trunk/modules/management/pom.xml 2011-01-11 14:20:09 UTC (rev 13553)
@@ -29,6 +29,21 @@
<scope>provided</scope>
<type>zip</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-jboss600</artifactId>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<!-- [JBWS-2505] -->
<!-- START -->
<!--
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2011-01-11 14:19:31 UTC (rev 13552)
+++ stack/native/trunk/pom.xml 2011-01-11 14:20:09 UTC (rev 13553)
@@ -49,6 +49,7 @@
<jbossws.spi.version>2.0.0-SNAPSHOT</jbossws.spi.version>
<jbossws.common.version>2.0.0-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>4.0.0-SNAPSHOT</jbossws.framework.version>
+ <jbossws.jboss600.version>4.0.0-SNAPSHOT</jbossws.jboss600.version>
<!-- [JBWS-2505] -->
<!-- START -->
<!--
@@ -105,6 +106,18 @@
<classifier>testsuite</classifier>
<type>zip</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-jboss600</artifactId>
+ <version>${jbossws.jboss600.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-jboss600</artifactId>
+ <version>${jbossws.jboss600.version}</version>
+ <classifier>resources</classifier>
+ <type>zip</type>
+ </dependency>
<!-- [JBWS-2505] -->
<!-- START -->
<!--
Modified: stack/native/trunk/src/main/distro/build-deploy.xml
===================================================================
--- stack/native/trunk/src/main/distro/build-deploy.xml 2011-01-11 14:19:31 UTC (rev 13552)
+++ stack/native/trunk/src/main/distro/build-deploy.xml 2011-01-11 14:20:09 UTC (rev 13553)
@@ -22,7 +22,7 @@
<param name="jbossid" value="${jbossws.integration.target}"/>
<param name="artifactsdir" value="${deploy.artifacts.dir}"/>
<param name="thirdpartydir" value="${deploy.artifacts.dir}"/>
- <param name="modifyjbossintegration" value="false"/><!-- [JBWS-2505] -->
+ <param name="modifyjbossintegration" value="true"/><!-- [JBWS-2505] -->
</antcall>
<macro-create-deploy-conf deploystructure="${deploy.structure}"/>
</target>
@@ -49,7 +49,7 @@
<macro-undeploy-jbossws targetdir="${jboss600.server}"
defaultconf="${jbossws.default.deploy.conf}"
defaultserverconf="${jbossws.default.server.deploy.conf}"
- modifyjbossintegration="false"/><!-- [JBWS-2505] -->
+ modifyjbossintegration="true"/><!-- [JBWS-2505] -->
</target>
<!-- ================================================================== -->
Modified: stack/native/trunk/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/native/trunk/src/main/scripts/assembly-deploy-artifacts.xml 2011-01-11 14:19:31 UTC (rev 13552)
+++ stack/native/trunk/src/main/scripts/assembly-deploy-artifacts.xml 2011-01-11 14:20:09 UTC (rev 13553)
@@ -132,6 +132,16 @@
<include>juddi:juddi:jar</include>
</includes>
</dependencySet>
+ <dependencySet>
+ <outputDirectory>deploy-artifacts/lib</outputDirectory>
+ <outputFileNameMapping>jbossws-jboss600.${module.extension}</outputFileNameMapping>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>provided</scope>
+ <unpack>false</unpack>
+ <includes>
+ <include>org.jboss.ws:jbossws-jboss600:jar</include>
+ </includes>
+ </dependencySet>
<!-- [JBWS-2505] -->
<!-- START -->
<!--
13 years, 11 months
JBossWS SVN: r13552 - in stack/cxf/trunk: modules/management and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 09:19:31 -0500 (Tue, 11 Jan 2011)
New Revision: 13552
Modified:
stack/cxf/trunk/modules/management/pom.xml
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/pom.xml
stack/cxf/trunk/src/main/distro/build-deploy.xml
stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml
Log:
use created ASIL for jboss 600 Final
Modified: stack/cxf/trunk/modules/management/pom.xml
===================================================================
--- stack/cxf/trunk/modules/management/pom.xml 2011-01-11 14:11:18 UTC (rev 13551)
+++ stack/cxf/trunk/modules/management/pom.xml 2011-01-11 14:19:31 UTC (rev 13552)
@@ -29,12 +29,9 @@
<scope>provided</scope>
<type>zip</type>
</dependency>
- <!-- [JBWS-2505] -->
- <!-- START -->
- <!--
<dependency>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss600M5</artifactId>
+ <artifactId>jbossws-jboss600</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
@@ -47,6 +44,9 @@
</exclusion>
</exclusions>
</dependency>
+ <!-- [JBWS-2505] -->
+ <!-- START -->
+ <!--
<dependency>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss600x</artifactId>
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2011-01-11 14:11:18 UTC (rev 13551)
+++ stack/cxf/trunk/modules/server/pom.xml 2011-01-11 14:19:31 UTC (rev 13552)
@@ -268,6 +268,31 @@
</resource>
</resources>
<plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>org.jboss.ws:jbossws-jboss*:zip:resources</artifactItems>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-jboss600</artifactId>
+ <version>${jbossws.jboss600.version}</version>
+ <classifier>resources</classifier>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}/resources/jbossws-jboss600</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<!-- JBWS-2505 -->
<!-- START -->
<!--
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2011-01-11 14:11:18 UTC (rev 13551)
+++ stack/cxf/trunk/pom.xml 2011-01-11 14:19:31 UTC (rev 13552)
@@ -49,6 +49,7 @@
<jbossws.spi.version>2.0.0-SNAPSHOT</jbossws.spi.version>
<jbossws.common.version>2.0.0-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>4.0.0-SNAPSHOT</jbossws.framework.version>
+ <jbossws.jboss600.version>4.0.0-SNAPSHOT</jbossws.jboss600.version>
<!-- JBWS-2505 -->
<!-- START -->
<!--
@@ -117,6 +118,18 @@
<classifier>testsuite</classifier>
<type>zip</type>
</dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-jboss600</artifactId>
+ <version>${jbossws.jboss600.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-jboss600</artifactId>
+ <version>${jbossws.jboss600.version}</version>
+ <classifier>resources</classifier>
+ <type>zip</type>
+ </dependency>
<!-- JBWS-2505 -->
<!-- START -->
<!--
Modified: stack/cxf/trunk/src/main/distro/build-deploy.xml
===================================================================
--- stack/cxf/trunk/src/main/distro/build-deploy.xml 2011-01-11 14:11:18 UTC (rev 13551)
+++ stack/cxf/trunk/src/main/distro/build-deploy.xml 2011-01-11 14:19:31 UTC (rev 13552)
@@ -22,7 +22,7 @@
<param name="jbossid" value="${jbossws.integration.target}"/>
<param name="artifactsdir" value="${deploy.artifacts.dir}"/>
<param name="thirdpartydir" value="${deploy.artifacts.dir}"/>
- <param name="modifyjbossintegration" value="false"/><!-- [JBWS-2505] -->
+ <param name="modifyjbossintegration" value="true"/><!-- [JBWS-2505] -->
</antcall>
</target>
@@ -49,7 +49,7 @@
<macro-undeploy-jbossws targetdir="${jboss600.server}"
defaultconf="${jbossws.default.deploy.conf}"
defaultserverconf="${jbossws.default.server.deploy.conf}"
- modifyjbossintegration="false"
+ modifyjbossintegration="true"
removenativecore="false" /><!-- [JBWS-2505][JBWS-2895] -->
</target>
Modified: stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml 2011-01-11 14:11:18 UTC (rev 13551)
+++ stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml 2011-01-11 14:19:31 UTC (rev 13552)
@@ -130,6 +130,16 @@
<include>juddi:juddi:jar</include>
</includes>
</dependencySet>
+ <dependencySet>
+ <outputDirectory>deploy-artifacts/lib</outputDirectory>
+ <outputFileNameMapping>jbossws-jboss600.${module.extension}</outputFileNameMapping>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>provided</scope>
+ <unpack>false</unpack>
+ <includes>
+ <include>org.jboss.ws:jbossws-jboss600:jar</include>
+ </includes>
+ </dependencySet>
<!-- [JBWS-2505] -->
<!-- START -->
<!--
13 years, 11 months
JBossWS SVN: r13551 - container/jboss60/branches/jbossws-jboss600.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 09:11:18 -0500 (Tue, 11 Jan 2011)
New Revision: 13551
Modified:
container/jboss60/branches/jbossws-jboss600/pom.xml
Log:
jbossws-parent defines whether compiler deprecation is populated or not
Modified: container/jboss60/branches/jbossws-jboss600/pom.xml
===================================================================
--- container/jboss60/branches/jbossws-jboss600/pom.xml 2011-01-11 14:08:22 UTC (rev 13550)
+++ container/jboss60/branches/jbossws-jboss600/pom.xml 2011-01-11 14:11:18 UTC (rev 13551)
@@ -261,7 +261,6 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <showDeprecation>false</showDeprecation>
<compilerArguments>
<endorseddirs>${project.build.directory}/endorsed</endorseddirs>
</compilerArguments>
13 years, 11 months
JBossWS SVN: r13550 - in container/jboss60/branches/jbossws-jboss600: src/main/java/org/jboss/webservices/integration and 14 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 09:08:22 -0500 (Tue, 11 Jan 2011)
New Revision: 13550
Added:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/VirtualFileAdaptor.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/WebServiceContextResourceProvider.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorResolverImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java
container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.security.JAASSecurityDomainAdaptorResolver
Modified:
container/jboss60/branches/jbossws-jboss600/pom.xml
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JMSDescriptorDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSAspectizedDeployersFactory.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilder.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSVirtualFileFilter.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/HornetQJMSResolver.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/ServiceEndpointInterceptorEJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB3.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderJSE.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/PublishLocationAdapterImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterFactoryImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterImpl.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/AbstractSecurityMetaDataAccessorEJB.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB21.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB3.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifyingDeploymentAspect.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/WebMetaDataHelper.java
container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
creating AS IL for AS 600.Final
Modified: container/jboss60/branches/jbossws-jboss600/pom.xml
===================================================================
--- container/jboss60/branches/jbossws-jboss600/pom.xml 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/pom.xml 2011-01-11 14:08:22 UTC (rev 13550)
@@ -2,12 +2,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBoss Web Services - Container JBoss-6.0.0.M5</name>
+ <name>JBoss Web Services - Container JBoss-6.0.0.Final</name>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-jboss600M5</artifactId>
- <description>JBossWS Container integration for JBoss AS 6.0.0.M5</description>
+ <artifactId>jbossws-jboss600</artifactId>
+ <description>JBossWS Container integration for JBoss AS 6.0.0.Final</description>
- <version>3.4.0-SNAPSHOT</version>
+ <version>4.0.0-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -18,31 +18,38 @@
<!-- Source Control Management -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossws/container/jboss60/branches...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossws/container/jboss60/branches/jb...</developerConnection>
- <url>http://fisheye.jboss.com/viewrep/JBossWS/container/jboss60/branches/jboss...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossws/container/jboss60/branches...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossws/container/jboss60/branches/jb...</developerConnection>
+ <url>http://fisheye.jboss.com/viewrep/JBossWS/container/jboss60/branches/jboss...</url>
</scm>
<!-- Properties -->
<properties>
- <jbossws.framework.version>3.4.0-SNAPSHOT</jbossws.framework.version>
- <jbossws.common.version>1.4.0-SNAPSHOT</jbossws.common.version>
- <jbossws.spi.version>1.4.0-SNAPSHOT</jbossws.spi.version>
- <jboss.version>6.0.0.20100911-M5</jboss.version>
- <jboss.deployers.version>2.2.0.Alpha7</jboss.deployers.version>
- <jboss.jbossxb.version>2.0.2.Beta7</jboss.jbossxb.version>
- <jboss.metadata.version>2.0.0.Alpha16</jboss.metadata.version>
- <jboss.reflect.version>2.2.0.Alpha9</jboss.reflect.version>
- <jboss.security.version>3.0.0.Beta4</jboss.security.version>
- <jboss.vfs.version>3.0.0.CR5</jboss.vfs.version>
- <jboss.cl.version>2.2.0.Alpha8</jboss.cl.version>
+ <jbossws.framework.version>4.0.0-SNAPSHOT</jbossws.framework.version>
+ <jbossws.common.version>2.0.0-SNAPSHOT</jbossws.common.version>
+ <jbossws.spi.version>2.0.0-SNAPSHOT</jbossws.spi.version>
+ <jboss.version>6.0.0.Final</jboss.version>
+ <jboss.deployers.version>2.2.0.GA</jboss.deployers.version>
+ <jboss.jbossxb.version>2.0.3.GA</jboss.jbossxb.version>
+ <jboss.metadata.version>2.0.0.Alpha24</jboss.metadata.version>
+ <jboss.reflect.version>2.2.0.GA</jboss.reflect.version>
+ <jboss.picketbox.version>3.0.0.CR2</jboss.picketbox.version>
+ <jboss.vfs.version>3.0.0.GA</jboss.vfs.version>
+ <jboss.cl.version>2.2.0.GA</jboss.cl.version>
+ <jboss.weld.version>1.1.Beta2</jboss.weld.version>
<jboss.hornetq.version>2.1.2.Final</jboss.hornetq.version>
+ <jboss.jaxws.api.version>1.0.0.Final</jboss.jaxws.api.version>
</properties>
<!-- DependencyManagement -->
<dependencyManagement>
<dependencies>
<dependency>
+ <groupId>org.jboss.spec.javax.xml.ws</groupId>
+ <artifactId>jboss-jaxws-api_2.2_spec</artifactId>
+ <version>${jboss.jaxws.api.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-framework</artifactId>
<version>${jbossws.framework.version}</version>
@@ -115,9 +122,9 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.jboss.security</groupId>
+ <groupId>org.picketbox</groupId>
<artifactId>jboss-security-spi</artifactId>
- <version>${jboss.security.version}</version>
+ <version>${jboss.picketbox.version}</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
@@ -129,6 +136,16 @@
<artifactId>hornetq-jms</artifactId>
<version>${jboss.hornetq.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>weld-int-deployer</artifactId>
+ <version>${jboss.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-spi</artifactId>
+ <version>${jboss.weld.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -151,9 +168,8 @@
<!-- jboss provided dependencies -->
<dependency>
- <groupId>javax.xml.ws</groupId>
- <artifactId>jaxws-api</artifactId>
- <version>2.1</version>
+ <groupId>org.jboss.spec.javax.xml.ws</groupId>
+ <artifactId>jboss-jaxws-api_2.2_spec</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -183,10 +199,20 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.security</groupId>
+ <groupId>org.picketbox</groupId>
<artifactId>jboss-security-spi</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>weld-int-deployer</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
<!-- transitive dependencies -->
<dependency>
@@ -233,6 +259,39 @@
</resources>
<plugins>
<plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <showDeprecation>false</showDeprecation>
+ <compilerArguments>
+ <endorseddirs>${project.build.directory}/endorsed</endorseddirs>
+ </compilerArguments>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.spec.javax.xml.ws</groupId>
+ <artifactId>jboss-jaxws-api_2.2_spec</artifactId>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -36,7 +36,6 @@
*/
public final class ServerConfigFactoryImpl extends ServerConfigFactory
{
-
/** The bean name in the kernel registry. */
private static final String BEAN_NAME = "WSServerConfig";
@@ -50,7 +49,7 @@
/**
* Returns config registered in MC kernel.
- *
+ *
* @return config
*/
public ServerConfig getServerConfig()
@@ -58,8 +57,7 @@
final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
final IoCContainerProxyFactory iocContainerFactory = spiProvider.getSPI(IoCContainerProxyFactory.class);
final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
-
+
return iocContainer.getBean(ServerConfigFactoryImpl.BEAN_NAME, ServerConfig.class);
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/config/ServerConfigImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -40,7 +40,6 @@
*/
public final class ServerConfigImpl extends AbstractServerConfig implements AbstractServerConfigMBean
{
-
/**
* Constructor.
*/
@@ -51,17 +50,17 @@
/**
* Gets server temp directory.
- *
+ *
* @return temp directory
*/
public File getServerTempDir()
{
return this.getDirFromServerConfig("ServerTempLocation");
}
-
+
/**
* Gets server home directory.
- *
+ *
* @return home directory
*/
public File getHomeDir()
@@ -71,14 +70,14 @@
/**
* Gets server data directory.
- *
+ *
* @return data directory
*/
public File getServerDataDir()
{
return this.getDirFromServerConfig("ServerDataLocation");
}
-
+
/**
* Obtains the requested directory from the server configuration.
*
@@ -114,5 +113,4 @@
return dir;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/AbstractDescriptorDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -21,59 +21,48 @@
*/
package org.jboss.webservices.integration.deployers;
-import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.vfs.VFSInputSource;
import org.jboss.vfs.VirtualFile;
-import org.jboss.wsf.spi.metadata.DescriptorProcessor;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.xml.sax.InputSource;
+import org.jboss.wsf.spi.metadata.DescriptorParser;
/**
- * Abstract descriptor deployer.
+ * Abstract descriptor deployer which deploys only if particular DD processor is available.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-abstract class AbstractDescriptorDeployer<P extends DescriptorProcessor<T>, T> extends ObjectModelFactoryDeployer<T>
+abstract class AbstractDescriptorDeployer<P extends DescriptorParser<T>, T> extends AbstractVFSParsingDeployer<T>
{
- private P ddProcessor;
+ private P ddParser;
AbstractDescriptorDeployer(Class<T> output)
{
super(output);
this.setName("UNSPECIFIED");
- this.setUseSchemaValidation(false);
}
+ @SuppressWarnings({"deprecation", "unchecked"})
@Override
protected T parse(final VFSDeploymentUnit unit, final VirtualFile file, final T root) throws Exception
{
- if (this.ddProcessor != null)
+ if (this.ddParser != null)
{
- InputSource source = new VFSInputSource(file);
- ObjectModelFactory factory = this.ddProcessor.getFactory(file.toURL());
- return getHelper().parse(source, root, factory);
+ return this.ddParser.parse(file.toURL());
}
-
+
return null;
}
/**
- * MC incallback method. It will be invoked each time subclass specific DescriptorProcessor bean will be installed.
+ * MC incallback method. It will be invoked each time subclass specific DescriptorParser bean will be installed.
*/
- protected void setProcessor(final P ddProcessor)
+ protected void setParser(final P ddParser)
{
- if (this.ddProcessor != null)
- throw new IllegalStateException("Only one " + this.ddProcessor.getClass() + " instance can be installed in MC");
-
- this.ddProcessor = ddProcessor;
- this.setName(this.ddProcessor.getDescriptorName());
- this.setUseSchemaValidation(this.ddProcessor.isValidating());
+ if (this.ddParser != null)
+ throw new IllegalStateException("Only one " + this.ddParser.getClass() + " instance can be installed in MC");
+
+ this.ddParser = ddParser;
+ this.setName(this.ddParser.getDescriptorName());
}
-
- @Override
- protected ObjectModelFactory getObjectModelFactory(final T root)
- {
- throw new UnsupportedOperationException();
- }
+
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -31,10 +31,9 @@
* when a application-client.xml descriptor file is found in the deployment.
* This deployer then actually enables classpath modification when a jaxrpc-mapping
* is specified in the descriptor.
- *
+ *
* @author alessio.soldano(a)jboss.com
* @since 03-Feb-2010
- *
*/
public class JAXRPCAppClientClassPathDeployer extends JAXRPCClientClassPathDeployer<ApplicationClientMetaData>
{
@@ -42,7 +41,7 @@
{
super(ApplicationClientMetaData.class);
}
-
+
@Override
protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
{
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -32,10 +32,9 @@
* when a application-client.xml descriptor file is found in the deployment.
* This deployer then actually enables classpath modification when a jaxrpc-mapping
* is specified in the descriptor.
- *
+ *
* @author alessio.soldano(a)jboss.com
* @since 03-Feb-2010
- *
*/
public abstract class JAXRPCClientClassPathDeployer<T> extends JAXRPCIntegrationClassPathDeployer<T>
{
@@ -44,7 +43,7 @@
super(input);
setInput(input); //makes the input mandatory instead of optional
}
-
+
protected static boolean hasJaxRpcMappingReference(ServiceReferencesMetaData serviceReferences)
{
if (serviceReferences != null)
@@ -60,5 +59,4 @@
}
return false;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -35,10 +35,9 @@
* when a ejb-jar.xml descriptor file is found in the deployment.
* This deployer then actually enables classpath modification when a jaxrpc-mapping
* is specified in the descriptor.
- *
+ *
* @author alessio.soldano(a)jboss.com
* @since 03-Feb-2010
- *
*/
public class JAXRPCEjbClientClassPathDeployer extends JAXRPCClientClassPathDeployer<EjbJarMetaData>
{
@@ -46,7 +45,7 @@
{
super(EjbJarMetaData.class);
}
-
+
@Override
protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
{
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -36,25 +36,22 @@
* An abstract deployer that properly set the classpath for JAX-RPC deployments.
* This is performed adding a reference to an integration lib from the jaxrpc
* deployers to the deployment unit's classpath.
- *
+ *
* @author alessio.soldano(a)jboss.com
* @since 02-Feb-2010
- *
*/
public abstract class JAXRPCIntegrationClassPathDeployer<T> extends UrlIntegrationDeployer<T>
{
private Set<String> libs;
-
private boolean integrationLibsFound = false;
private ServerConfig wsServerConfig;
private boolean stackRequiresIntegration;
-
-
+
public JAXRPCIntegrationClassPathDeployer(Class<T> input)
{
super(input);
}
-
+
protected abstract boolean isClassPathChangeRequired(VFSDeploymentUnit unit);
@Override
@@ -62,13 +59,13 @@
{
return stackRequiresIntegration && integrationLibsFound && isClassPathChangeRequired(unit);
}
-
+
@Override
public void start()
{
//NOOP
}
-
+
protected Set<URL> getJBossWSIntegrationUrls()
{
Set<URL> result = new HashSet<URL>();
@@ -97,12 +94,7 @@
}
return result;
}
-
- /**
- * Get server home.
- *
- * @return the jboss server home location
- */
+
protected String getServerHome()
{
return "${jboss.server.home.url}";
@@ -130,5 +122,4 @@
//the Native stack does not requires the JAXRPC additional integration
stackRequiresIntegration = !wsServerConfig.getImplementationTitle().toLowerCase().contains("native");
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -30,10 +30,9 @@
* A deployer for properly setting the classpath for jaxrpc endpoint deployments;
* it's triggered by the WebservicesMetaData which is attached to the unit
* when a webservice.xml descriptor file is found in the deployment.
- *
+ *
* @author alessio.soldano(a)jboss.com
* @since 03-Feb-2010
- *
*/
public class JAXRPCServerClassPathDeployer extends JAXRPCIntegrationClassPathDeployer<WebservicesMetaData>
{
@@ -42,7 +41,7 @@
super(WebservicesMetaData.class);
setInput(WebservicesMetaData.class); //makes the input mandatory instead of optional
}
-
+
@Override
protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
{
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -31,10 +31,9 @@
* when a web.xml descriptor file is found in the deployment.
* This deployer then actually enables classpath modification when a jaxrpc-mapping
* is specified in the descriptor.
- *
+ *
* @author alessio.soldano(a)jboss.com
* @since 03-Feb-2010
- *
*/
public class JAXRPCServletClientClassPathDeployer extends JAXRPCClientClassPathDeployer<WebMetaData>
{
@@ -42,7 +41,7 @@
{
super(WebMetaData.class);
}
-
+
@Override
protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
{
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JMSDescriptorDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JMSDescriptorDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/JMSDescriptorDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -21,16 +21,17 @@
*/
package org.jboss.webservices.integration.deployers;
-import org.jboss.wsf.spi.metadata.jms.JMSDescriptorProcessor;
+import org.jboss.wsf.spi.metadata.jms.JMSDescriptorParser;
import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
/**
* Stack agnostic JMS descriptor deployer.
- *
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public final class JMSDescriptorDeployer extends AbstractDescriptorDeployer<JMSDescriptorProcessor, JMSEndpointsMetaData>
+public final class JMSDescriptorDeployer extends AbstractDescriptorDeployer<JMSDescriptorParser, JMSEndpointsMetaData>
{
+
/**
* Constructor.
*/
@@ -40,12 +41,13 @@
}
/**
- * MC incallback method. It will be invoked each time JMSDescriptorProcessor bean will be installed.
- * @param processor the processor
+ * MC incallback method. It will be invoked each time JMSDescriptorParser bean will be installed.
+ * @param parser the parser
*/
@Override
- public void setProcessor(final JMSDescriptorProcessor processor)
+ public void setParser(final JMSDescriptorParser parser)
{
- super.setProcessor(processor);
+ super.setParser(parser);
}
+
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -25,16 +25,16 @@
import java.security.PrivilegedAction;
/**
- *
+ * Security actions helper.
+ *
* @author alessio.soldano(a)jboss.com
* @since 17-Feb-2010
- *
*/
class SecurityActions
{
/**
* Get context classloader.
- *
+ *
* @return the current context classloader
*/
static ClassLoader getContextClassLoader()
@@ -54,7 +54,7 @@
});
}
}
-
+
/**
* Set context classloader.
*
@@ -78,5 +78,4 @@
});
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSAspectizedDeployersFactory.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSAspectizedDeployersFactory.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSAspectizedDeployersFactory.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -36,7 +36,6 @@
*/
public final class WSAspectizedDeployersFactory
{
-
/** Logger. */
private static final Logger LOGGER = Logger.getLogger(WSAspectizedDeployersFactory.class);
@@ -45,10 +44,10 @@
/** Our deployers regitry. */
private final Map<DeploymentAspect, Deployer> deployersRegistry = new HashMap<DeploymentAspect, Deployer>();
-
+
/**
* Constructor.
- *
+ *
* @param realDeployers real deployers registry
*/
public WSAspectizedDeployersFactory(final DeployersImpl realDeployers)
@@ -58,7 +57,7 @@
/**
* MC incallback method. It will be called each time DeploymentAspect bean will be installed.
- *
+ *
* @param aspect to create real WS aspectized deployer for
*/
public void addDeployer(final DeploymentAspect aspect)
@@ -75,7 +74,7 @@
/**
* MC uncallback method. It will be called each time DeploymentAspect bean will be removed.
- *
+ *
* @param aspect to remove real WS aspectized deployer for
*/
public void removeDeployer(final DeploymentAspect aspect)
@@ -89,5 +88,4 @@
this.deployersRegistry.remove(aspect);
this.delegee.removeDeployer(wsAspectizedDeployer);
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -35,7 +35,7 @@
/**
* A deployer that delegates to JBossWS deployment aspect.
- *
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
final class WSDeploymentAspectDeployer extends AbstractRealDeployer
@@ -52,7 +52,7 @@
/**
* Constructor.
- *
+ *
* @param aspect deployment aspect
*/
WSDeploymentAspectDeployer(final DeploymentAspect aspect)
@@ -102,7 +102,7 @@
/**
* If deployed unit is related to web services this method delegates
* to deployment aspect and calls its create() and start() methods.
- *
+ *
* @param unit deployment unit
* @throws DeploymentException on deployment failure
*/
@@ -133,7 +133,7 @@
/**
* If undeployed unit is related to web services this method delegates
* to deployment aspect and calls its stop() and destroy() methods.
- *
+ *
* @param unit deployment unit
*/
@Override
@@ -162,7 +162,7 @@
/**
* Displays also WS deployment aspect being wrapped.
- *
+ *
* @return deployer instance id including wrapped deployment aspect id.
*/
@Override
@@ -172,5 +172,4 @@
sb.append(super.toString()).append('(').append(this.aspect).append(')');
return sb.toString();
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -30,13 +30,12 @@
import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
/**
- * This deployer initializes JBossWS deployment meta data.
+ * This deployer initializes JBossWS deployment meta data.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public final class WSDeploymentDeployer extends AbstractRealDeployer
{
-
/**
* Constructor.
*/
@@ -55,7 +54,7 @@
/**
* Creates new Web Service deployment and registers it with deployment unit.
- *
+ *
* @param unit deployment unit
* @throws DeploymentException if any error occurs
*/
@@ -65,5 +64,4 @@
this.log.trace("Building JBoss agnostic webservices meta data model");
WSDeploymentBuilder.getInstance().build(unit);
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSDescriptorDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -21,7 +21,7 @@
*/
package org.jboss.webservices.integration.deployers;
-import org.jboss.wsf.spi.metadata.webservices.WebservicesDescriptorProcessor;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesDescriptorParser;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
/**
@@ -29,8 +29,9 @@
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public final class WSDescriptorDeployer extends AbstractDescriptorDeployer<WebservicesDescriptorProcessor, WebservicesMetaData>
+public final class WSDescriptorDeployer extends AbstractDescriptorDeployer<WebservicesDescriptorParser, WebservicesMetaData>
{
+
/**
* Constructor.
*/
@@ -38,14 +39,15 @@
{
super(WebservicesMetaData.class);
}
-
+
/**
- * MC incallback method. It will be invoked each time WebservicesDescriptorProcessor bean will be installed.
- * @param processor the processor
+ * MC incallback method. It will be invoked each time WebservicesDescriptorParser bean will be installed.
+ * @param parser the parser
*/
@Override
- public void setProcessor(final WebservicesDescriptorProcessor processor)
+ public void setParser(final WebservicesDescriptorParser parser)
{
- super.setProcessor(processor);
+ super.setParser(parser);
}
+
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSEJBAdapterDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -49,7 +49,6 @@
*/
public final class WSEJBAdapterDeployer extends AbstractRealDeployer
{
-
/**
* Constructor.
*/
@@ -69,7 +68,7 @@
/**
* Deploys WebServiceDeployment meta data.
- *
+ *
* @param unit deployment unit
* @throws DeploymentException exception
*/
@@ -107,7 +106,7 @@
/**
* Returns EJB container if EJB3 deployment is detected and EJB meta data does not represent entity bean.
- *
+ *
* @param ejb3Deployment EJB3 deployment meta data
* @param ejbMD EJB meta data
* @return EJB container or null if not EJB3 stateless bean
@@ -150,7 +149,7 @@
/**
* Constructor.
- *
+ *
* @param ejbMetaData EJB metadata
* @param ejbContainer EJB container
* @param loader class loader
@@ -234,7 +233,6 @@
+ " from loader: " + this.loader);
}
}
-
}
/**
@@ -243,7 +241,6 @@
*/
private static final class WebServiceDeploymentAdapter implements WebServiceDeployment
{
-
/** List of endpoints. */
private final List<WebServiceDeclaration> endpoints = new ArrayList<WebServiceDeclaration>();
@@ -257,14 +254,12 @@
/**
* Returns endpoints list.
- *
+ *
* @return endpoints list
*/
public List<WebServiceDeclaration> getServiceEndpoints()
{
return this.endpoints;
}
-
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/WSTypeDeployer.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -39,7 +39,6 @@
*/
public final class WSTypeDeployer extends AbstractRealDeployer
{
-
/**
* Constructor.
*/
@@ -59,7 +58,7 @@
/**
* Detects WS deployment type and puts it to the deployment unit attachments.
- *
+ *
* @param unit deployment unit
* @throws DeploymentException on failure
*/
@@ -95,7 +94,7 @@
/**
* Returns true if JAXRPC EJB deployment is detected.
- *
+ *
* @param unit deployment unit
* @return true if JAXRPC EJB, false otherwise
*/
@@ -109,7 +108,7 @@
/**
* Returns true if JAXRPC JSE deployment is detected.
- *
+ *
* @param unit deployment unit
* @return true if JAXRPC JSE, false otherwise
*/
@@ -128,7 +127,7 @@
/**
* Returns true if JAXWS EJB deployment is detected.
- *
+ *
* @param unit deployment unit
* @return true if JAXWS EJB, false otherwise
*/
@@ -146,7 +145,7 @@
/**
* Returns true if JAXWS JSE deployment is detected.
- *
+ *
* @param unit deployment unit
* @return true if JAXWS JSE, false otherwise
*/
@@ -164,7 +163,7 @@
/**
* Returns true if JAXWS JMS deployment is detected.
- *
+ *
* @param unit deployment unit
* @return true if JAXWS JMS, false otherwise
*/
@@ -172,5 +171,4 @@
{
return ASHelper.hasAttachment(unit, JMSEndpointsMetaData.class);
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/AbstractDeploymentModelBuilder.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -1,6 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webservices.integration.deployers.deployment;
-import java.io.IOException;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -9,8 +29,8 @@
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.logging.Logger;
-import org.jboss.metadata.serviceref.VirtualFileAdaptor;
import org.jboss.vfs.VirtualFile;
+import org.jboss.webservices.integration.injection.VirtualFileAdaptor;
import org.jboss.webservices.integration.util.ASHelper;
import org.jboss.wsf.common.ResourceLoaderAdapter;
import org.jboss.wsf.spi.SPIProvider;
@@ -21,7 +41,6 @@
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.wsf.spi.deployment.WSFDeploymentException;
/**
* Base class for all deployment model builders.
@@ -30,7 +49,6 @@
*/
abstract class AbstractDeploymentModelBuilder implements DeploymentModelBuilder
{
-
/** WSDL, XSD and XML files filter. */
private static final WSVirtualFileFilter WS_FILE_FILTER = new WSVirtualFileFilter();
@@ -148,7 +166,7 @@
for (VirtualFile vf : virtualFiles)
{
// Adding the roots of the virtual files.
- uVirtualFiles.add(new VirtualFileAdaptor(vf)); // TODO: Figure out why this was using the VFS2 VFS root instead of the meta-data file itself.
+ uVirtualFiles.add(new VirtualFileAdaptor(vf));
}
dep.setMetadataFiles(new LinkedList<UnifiedVirtualFile>(uVirtualFiles));
}
@@ -214,5 +232,4 @@
throw new IllegalStateException("Deployment unit does not contain " + attachment);
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilder.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilder.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webservices.integration.deployers.deployment;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -4,17 +25,15 @@
/**
* Deployment builder interface.
- *
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
interface DeploymentModelBuilder
{
-
/**
* Creates Web Service deployment model and associates it with deployment.
- *
+ *
* @param unit deployment unit
*/
void newDeploymentModel(DeploymentUnit unit);
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_EJB21.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webservices.integration.deployers.deployment;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -11,12 +32,11 @@
/**
* Creates new JAXRPC EJB21 deployment.
- *
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
final class DeploymentModelBuilderJAXRPC_EJB21 extends AbstractDeploymentModelBuilder
{
-
/**
* Constructor.
*/
@@ -27,7 +47,7 @@
/**
* Creates new JAXRPC EJB21 deployment and registers it with deployment unit.
- *
+ *
* @param dep webservice deployment
* @param unit deployment unit
*/
@@ -53,5 +73,4 @@
}
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXRPC_JSE.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webservices.integration.deployers.deployment;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -11,12 +32,11 @@
/**
* Creates new JAXRPC JSE deployment.
- *
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
final class DeploymentModelBuilderJAXRPC_JSE extends AbstractDeploymentModelBuilder
{
-
/**
* Constructor.
*/
@@ -27,7 +47,7 @@
/**
* Creates new JAXRPC JSE deployment and registers it with deployment unit.
- *
+ *
* @param dep webservice deployment
* @param unit deployment unit
*/
@@ -52,5 +72,4 @@
}
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_EJB3.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webservices.integration.deployers.deployment;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -10,12 +31,11 @@
/**
* Creates new JAXWS EJB3 deployment.
- *
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
final class DeploymentModelBuilderJAXWS_EJB3 extends AbstractDeploymentModelBuilder
{
-
/**
* Constructor.
*/
@@ -26,7 +46,7 @@
/**
* Creates new JAXWS EJB3 deployment and registers it with deployment unit.
- *
+ *
* @param dep webservice deployment
* @param unit deployment unit
*/
@@ -48,5 +68,4 @@
ep.setProperty(ASHelper.CONTAINER_NAME, container.getContainerName());
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JMS.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -32,40 +32,38 @@
import org.jboss.wsf.spi.metadata.jms.JMSEndpointsMetaData;
/**
- * Create JAXWS SPI Deployment for JAXWS_JMS type deployment
- * @author <a herf="ema(a)redhat.com>Jim Ma</a>
+ * Create JAXWS SPI Deployment for JAXWS_JMS type deployment.
*
+ * @author <a herf="ema(a)redhat.com>Jim Ma</a>
*/
public class DeploymentModelBuilderJAXWS_JMS extends AbstractDeploymentModelBuilder
{
+ /**
+ * Constructor.
+ */
+ DeploymentModelBuilderJAXWS_JMS()
+ {
+ super();
+ }
- /**
- * Constructor.
- */
- DeploymentModelBuilderJAXWS_JMS()
- {
- super();
- }
-
- /**
- * Creates new JAXWS JMS deployment and registers it with deployment unit.
- *
- * @param dep webservice deployment
- * @param unit deployment unit
- */
- @Override
- protected void build(final Deployment dep, final DeploymentUnit unit)
- {
- this.getAndPropagateAttachment(JMSEndpointsMetaData.class, unit, dep);
- JMSEndpointsMetaData jmsEndpointsMD = dep.getAttachment(JMSEndpointsMetaData.class);
- for (JMSEndpointMetaData endpoint : jmsEndpointsMD.getEndpointsMetaData())
- {
- if (endpoint.getName() == null)
- {
- endpoint.setName(endpoint.getImplementor());
- }
- this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep);
- }
- }
-
- }
\ No newline at end of file
+ /**
+ * Creates new JAXWS JMS deployment and registers it with deployment unit.
+ *
+ * @param dep webservice deployment
+ * @param unit deployment unit
+ */
+ @Override
+ protected void build(final Deployment dep, final DeploymentUnit unit)
+ {
+ this.getAndPropagateAttachment(JMSEndpointsMetaData.class, unit, dep);
+ JMSEndpointsMetaData jmsEndpointsMD = dep.getAttachment(JMSEndpointsMetaData.class);
+ for (JMSEndpointMetaData endpoint : jmsEndpointsMD.getEndpointsMetaData())
+ {
+ if (endpoint.getName() == null)
+ {
+ endpoint.setName(endpoint.getImplementor());
+ }
+ this.newJMSEndpoint(endpoint.getImplementor(), endpoint.getName(), dep);
+ }
+ }
+}
\ No newline at end of file
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/DeploymentModelBuilderJAXWS_JSE.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webservices.integration.deployers.deployment;
import java.util.List;
@@ -10,12 +31,11 @@
/**
* Creates new JAXWS JSE deployment.
- *
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
final class DeploymentModelBuilderJAXWS_JSE extends AbstractDeploymentModelBuilder
{
-
/**
* Constructor.
*/
@@ -26,7 +46,7 @@
/**
* Creates new JAXWS JSE deployment and registers it with deployment unit.
- *
+ *
* @param dep webservice deployment
* @param unit deployment unit
*/
@@ -47,5 +67,4 @@
this.newHttpEndpoint(servletClass, servletName, dep);
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSDeploymentBuilder.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -35,7 +35,6 @@
*/
public final class WSDeploymentBuilder
{
-
/** Builder instance. */
private static final WSDeploymentBuilder SINGLETON = new WSDeploymentBuilder();
@@ -61,7 +60,7 @@
/**
* Factory method for obtaining builder instance.
- *
+ *
* @return builder instance
*/
public static WSDeploymentBuilder getInstance()
@@ -71,7 +70,7 @@
/**
* Builds JBossWS deployment model if web service deployment is detected.
- *
+ *
* @param unit deployment unit
*/
public void build(final DeploymentUnit unit)
@@ -83,5 +82,4 @@
WSDeploymentBuilder.builders.get(deploymentType).newDeploymentModel(unit);
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSVirtualFileFilter.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSVirtualFileFilter.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/deployers/deployment/WSVirtualFileFilter.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webservices.integration.deployers.deployment;
import org.jboss.vfs.VirtualFile;
@@ -6,18 +27,17 @@
/**
* WS file filter for files with the '.wsdl', or '.xsd' or '.xml' suffix.
- *
+ *
* @author <a href="mailto:dbevenius@jboss.com">Daniel Bevenius</a>
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
final class WSVirtualFileFilter implements VirtualFileFilterWithAttributes
{
-
/** The tree walking attributes. */
private VisitorAttributes attributes;
/**
- * Constructor.
+ * Constructor.
*/
WSVirtualFileFilter()
{
@@ -26,7 +46,7 @@
/**
* Constructor.
- *
+ *
* @param attributes visit attributes
*/
WSVirtualFileFilter(final VisitorAttributes attributes)
@@ -36,7 +56,7 @@
/**
* Gets VisitorAttributes for this instance.
- *
+ *
* @return visitor attributes
*/
public VisitorAttributes getAttributes()
@@ -64,5 +84,4 @@
return hasWsdlSuffix || hasXsdSuffix || hasXmlSuffix;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/HornetQJMSResolver.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/HornetQJMSResolver.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/endpoint/HornetQJMSResolver.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -29,9 +29,8 @@
/**
* A JMS endpoint resolver meant for working with HornetQ destination implementation
- *
- * @author alessio.soldano(a)jboss.com
*
+ * @author alessio.soldano(a)jboss.com
*/
public class HornetQJMSResolver extends DefaultJMSEndpointResolver
{
@@ -46,5 +45,4 @@
super.setDestination(destination);
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/EJBBeanReferenceResolver.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -27,8 +27,8 @@
import javax.ejb.EJB;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.ejb3.common.resolvers.spi.EjbReference;
-import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
+import org.jboss.ejb3.ejbref.resolver.spi.EjbReference;
+import org.jboss.ejb3.ejbref.resolver.spi.EjbReferenceResolver;
import org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver;
/**
@@ -38,7 +38,6 @@
*/
final class EJBBeanReferenceResolver extends AbstractReferenceResolver<EJB>
{
-
/**
* Deployment unit used for resolving process.
*/
@@ -74,7 +73,7 @@
/**
* @see org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveField(java.lang.reflect.Field)
- *
+ *
* @param field to be resolved
* @return JNDI name of referenced EJB object
*/
@@ -90,7 +89,7 @@
/**
* @see org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveMethod(java.lang.reflect.Method)
- *
+ *
* @param method to be resolved
* @return JNDI name of referenced EJB object
*/
@@ -120,5 +119,4 @@
}
return new EjbReference(ejbAnnotation.beanName(), beanInterface, ejbAnnotation.mappedName());
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -33,7 +33,7 @@
import javax.ejb.EJB;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
+import org.jboss.ejb3.ejbref.resolver.spi.EjbReferenceResolver;
import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
@@ -102,7 +102,7 @@
/**
* Builds injection meta data for all endpoints in deployment.
- *
+ *
* @param dep webservice deployment
*/
@Override
@@ -154,7 +154,7 @@
/**
* Returns environment entries meta data associated with specified EJB 3 bean.
- *
+ *
* @param ejbName EJB 3 bean to lookup environment entries for
* @param unit deployment unit
* @return environment entries meta data
@@ -185,7 +185,7 @@
/**
* Builds JBossWS specific injections meta data.
- *
+ *
* @param envEntriesMD environment entries meta data
* @param resolvers known annotation resolvers
* @param jndiContext JNDI context to be propagated
@@ -253,5 +253,4 @@
return retVal;
}
-
}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/ServiceRefResourceProvider.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -0,0 +1,700 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservices.integration.injection;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.Referenceable;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.WebServiceRefs;
+import javax.xml.ws.soap.MTOM;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.switchboard.javaee.environment.Addressing;
+import org.jboss.switchboard.javaee.environment.Handler;
+import org.jboss.switchboard.javaee.environment.HandlerChain;
+import org.jboss.switchboard.javaee.environment.InjectionTarget;
+import org.jboss.switchboard.javaee.environment.PortComponent;
+import org.jboss.switchboard.javaee.environment.ServiceRefType;
+import org.jboss.switchboard.javaee.jboss.environment.JBossPortComponent;
+import org.jboss.switchboard.javaee.jboss.environment.JBossServiceRefType;
+import org.jboss.switchboard.mc.spi.MCBasedResourceProvider;
+import org.jboss.switchboard.spi.Resource;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedCallPropertyMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
+
+/**
+ * Service reference resource provider.
+ *
+ * Conventions used in this source code are:
+ * <ul>
+ * <li>SBMD - switch board meta data</li>
+ * <li>UMDM - jbossws unified meta data model</li>
+ * </ul>
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class ServiceRefResourceProvider implements MCBasedResourceProvider<ServiceRefType>
+{
+
+ private static final Logger log = Logger.getLogger(ServiceRefResourceProvider.class);
+
+ private final ServiceRefHandler delegate;
+
+ /**
+ * Constructor.
+ */
+ public ServiceRefResourceProvider()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ this.delegate = spiProvider.getSPI(ServiceRefHandlerFactory.class).getServiceRefHandler();
+ }
+
+ /**
+ * Provides service ref resource.
+ */
+ @Override
+ public Resource provide(final DeploymentUnit deploymentUnit, final ServiceRefType serviceRefSBMD)
+ {
+ final ClassLoader newLoader = deploymentUnit.getClassLoader();
+ final ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
+
+ try
+ {
+ Thread.currentThread().setContextClassLoader(newLoader);
+ final UnifiedVirtualFile vfsRoot = this.getUnifiedVirtualFile(deploymentUnit);
+ final UnifiedServiceRefMetaData serviceRefUMDM = this.getUnifiedServiceRefMetaData(vfsRoot, serviceRefSBMD,
+ newLoader);
+ final Referenceable jndiReferenceable = this.delegate.createReferenceable(serviceRefUMDM);
+
+ return new ServiceRefResource(jndiReferenceable);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldLoader);
+ }
+ }
+
+ /**
+ * Inform about type this resource handler can handle.
+ *
+ * @return handled type
+ */
+ @Override
+ public Class<ServiceRefType> getEnvironmentEntryType()
+ {
+ return ServiceRefType.class;
+ }
+
+ /**
+ * Constructs vfs root from deployment unit.
+ *
+ * @param deploymentUnit
+ * @return vfs root
+ */
+ private UnifiedVirtualFile getUnifiedVirtualFile(final DeploymentUnit deploymentUnit)
+ {
+ DeploymentUnit tempDeploymentUnit = deploymentUnit;
+ while (tempDeploymentUnit.isComponent())
+ tempDeploymentUnit = tempDeploymentUnit.getParent();
+
+ if (tempDeploymentUnit instanceof VFSDeploymentUnit)
+ {
+ VFSDeploymentUnit vdu = (VFSDeploymentUnit) tempDeploymentUnit;
+ return new VirtualFileAdaptor(vdu.getRoot());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Can only handle real VFS deployments: " + tempDeploymentUnit);
+ }
+ }
+
+ /**
+ * Translates service ref switchboard meta data to JBossWS unified service ref meta data.
+ *
+ * @param vfsRoot virtual file system root
+ * @param serviceRefSBMD service reference switchboard meta data
+ * @return unified jbossws service reference meta data
+ */
+ private UnifiedServiceRefMetaData getUnifiedServiceRefMetaData(final UnifiedVirtualFile vfsRoot,
+ final ServiceRefType serviceRefSBMD, final ClassLoader loader)
+ {
+ final UnifiedServiceRefMetaData serviceRefUMDM = new UnifiedServiceRefMetaData(vfsRoot);
+ serviceRefUMDM.setServiceRefName(serviceRefSBMD.getName());
+ serviceRefUMDM.setServiceRefType(serviceRefSBMD.getType());
+ serviceRefUMDM.setServiceInterface(serviceRefSBMD.getServiceInterface());
+ serviceRefUMDM.setWsdlFile(serviceRefSBMD.getWsdlFile());
+ serviceRefUMDM.setMappingFile(serviceRefSBMD.getMappingFile());
+ serviceRefUMDM.setServiceQName(serviceRefSBMD.getQName());
+ serviceRefUMDM.setHandlerChain(serviceRefSBMD.getHandlerChain());
+
+ // propagate addressing properties
+ serviceRefUMDM.setAddressingAnnotationSpecified(serviceRefSBMD.isAddressingFeatureEnabled());
+ serviceRefUMDM.setAddressingEnabled(serviceRefSBMD.isAddressingEnabled());
+ serviceRefUMDM.setAddressingRequired(serviceRefSBMD.isAddressingRequired());
+ serviceRefUMDM.setAddressingResponses(serviceRefSBMD.getAddressingResponses());
+
+ // propagate MTOM properties
+ serviceRefUMDM.setMtomAnnotationSpecified(serviceRefSBMD.isMtomFeatureEnabled());
+ serviceRefUMDM.setMtomEnabled(serviceRefSBMD.isMtomEnabled());
+ serviceRefUMDM.setMtomThreshold(serviceRefSBMD.getMtomThreshold());
+
+ // propagate respect binding properties
+ serviceRefUMDM.setRespectBindingAnnotationSpecified(serviceRefSBMD.isRespectBindingFeatureEnabled());
+ serviceRefUMDM.setRespectBindingEnabled(serviceRefSBMD.isRespectBindingEnabled());
+
+ // process injection targets
+ if (serviceRefSBMD.getInjectionTargets() != null && serviceRefSBMD.getInjectionTargets().size() > 0)
+ {
+ if (serviceRefSBMD.getInjectionTargets().size() > 1)
+ {
+ // TODO: We should validate all the injection targets whether they're compatible.
+ // This means all the injection targets must be assignable or equivalent.
+ // If there are @Addressing, @RespectBinding or @MTOM annotations present on injection targets,
+ // these annotations must be equivalent for all the injection targets.
+ }
+ final InjectionTarget injectionTarget = serviceRefSBMD.getInjectionTargets().iterator().next();
+
+ AccessibleObject anAlement = this.findInjectionTarget(loader, injectionTarget);
+ this.processAnnotatedElement(anAlement, serviceRefUMDM);
+ }
+
+ // propagate port compoments
+ final Collection<? extends PortComponent> portComponentsSBMD = serviceRefSBMD.getPortComponents();
+ if (portComponentsSBMD != null)
+ {
+ for (final PortComponent portComponentSBMD : portComponentsSBMD)
+ {
+ final UnifiedPortComponentRefMetaData portComponentUMDM = this.getUnifiedPortComponentRefMetaData(
+ serviceRefUMDM, portComponentSBMD);
+ if (portComponentUMDM.getServiceEndpointInterface() != null || portComponentUMDM.getPortQName() != null)
+ {
+ serviceRefUMDM.addPortComponentRef(portComponentUMDM);
+ }
+ else
+ {
+ log.warn("Ignoring <port-component-ref> without <service-endpoint-interface> and <port-qname>: "
+ + portComponentUMDM);
+ }
+ }
+ }
+
+ // propagate handlers
+ final Collection<Handler> handlersSBMD = serviceRefSBMD.getHandlers();
+ if (handlersSBMD != null)
+ {
+ for (final Handler handlerSBMD : handlersSBMD)
+ {
+ final UnifiedHandlerMetaData handlerUMDM = this.getUnifiedHandlerMetaData(handlerSBMD);
+ serviceRefUMDM.addHandler(handlerUMDM);
+ }
+ }
+
+ // propagate handler chains
+ final List<HandlerChain> handlerChainsSBMD = serviceRefSBMD.getHandlerChains();
+ if (handlerChainsSBMD != null)
+ {
+ final UnifiedHandlerChainsMetaData handlerChainsUMDM = this.getUnifiedHandlerChainsMetaData(handlerChainsSBMD);
+ serviceRefUMDM.setHandlerChains(handlerChainsUMDM);
+ }
+
+ // propagate jboss specific MD
+ if (serviceRefSBMD instanceof JBossServiceRefType)
+ {
+ this.processUnifiedJBossServiceRefMetaData(serviceRefUMDM, serviceRefSBMD);
+ }
+
+ // detect JAXWS or JAXRPC type
+ this.processType(serviceRefUMDM);
+
+ return serviceRefUMDM;
+ }
+
+ /**
+ * Translates jboss service ref switchboard meta data to JBossWS unified service ref meta data.
+ *
+ * @param serviceRefUMDM service reference unified meta data
+ * @param serviceRefSBMD service reference switchboard meta data
+ */
+ private void processUnifiedJBossServiceRefMetaData(final UnifiedServiceRefMetaData serviceRefUMDM,
+ final ServiceRefType serviceRefSBMD)
+ {
+ final JBossServiceRefType jbossServiceRefSBMD = (JBossServiceRefType) serviceRefSBMD;
+ serviceRefUMDM.setServiceImplClass(jbossServiceRefSBMD.getServiceClass());
+ serviceRefUMDM.setConfigName(jbossServiceRefSBMD.getConfigName());
+ serviceRefUMDM.setConfigFile(jbossServiceRefSBMD.getConfigFile());
+ serviceRefUMDM.setWsdlOverride(jbossServiceRefSBMD.getWsdlOverride());
+ serviceRefUMDM.setHandlerChain(jbossServiceRefSBMD.getHandlerChain());
+ }
+
+ /**
+ * Translates handler chains switchboard meta data to JBossWS unified handler chains meta data.
+ *
+ * @param handlerChainsSBMD handler chains switchboard meta data
+ * @return handler chains JBossWS unified meta data
+ */
+ private UnifiedHandlerChainsMetaData getUnifiedHandlerChainsMetaData(final List<HandlerChain> handlerChainsSBMD)
+ {
+ final UnifiedHandlerChainsMetaData handlerChainsUMDM = new UnifiedHandlerChainsMetaData();
+
+ for (final HandlerChain handlerChainSBMD : handlerChainsSBMD)
+ {
+ final UnifiedHandlerChainMetaData handlerChainUMDM = new UnifiedHandlerChainMetaData();
+ handlerChainUMDM.setServiceNamePattern(handlerChainSBMD.getServiceNamePattern());
+ handlerChainUMDM.setPortNamePattern(handlerChainSBMD.getPortNamePattern());
+ handlerChainUMDM.setProtocolBindings(handlerChainSBMD.getProtocolBindings());
+
+ final List<Handler> handlersSBMD = handlerChainSBMD.getHandlers();
+ for (final Handler handlerSBMD : handlersSBMD)
+ {
+ final UnifiedHandlerMetaData handlerUMDM = getUnifiedHandlerMetaData(handlerSBMD);
+ handlerChainUMDM.addHandler(handlerUMDM);
+ }
+
+ handlerChainsUMDM.addHandlerChain(handlerChainUMDM);
+ }
+
+ return handlerChainsUMDM;
+ }
+
+ /**
+ * Translates handler switchboard meta data to JBossWS unified handler meta data.
+ *
+ * @param handlerSBMD handler switchboard meta data
+ * @return handler JBossWS unified meta data
+ */
+ private UnifiedHandlerMetaData getUnifiedHandlerMetaData(final Handler handlerSBMD)
+ {
+ final UnifiedHandlerMetaData handlerUMDM = new UnifiedHandlerMetaData();
+ handlerUMDM.setHandlerName(handlerSBMD.getHandlerName());
+ handlerUMDM.setHandlerClass(handlerSBMD.getHandlerClass());
+
+ // translate handler init params
+ final Map<String, String> handlerInitParamsSBMD = handlerSBMD.getInitParams();
+ if (handlerInitParamsSBMD != null)
+ {
+ for (final String initParamName : handlerInitParamsSBMD.keySet())
+ {
+ final UnifiedInitParamMetaData handlerInitParamUMDM = new UnifiedInitParamMetaData();
+ handlerInitParamUMDM.setParamName(initParamName);
+ handlerInitParamUMDM.setParamValue(handlerInitParamsSBMD.get(initParamName));
+ handlerUMDM.addInitParam(handlerInitParamUMDM);
+ }
+ }
+
+ // translate handler soap headers
+ final Collection<QName> handlerSoapHeadersSBDM = handlerSBMD.getSoapHeaders();
+ if (handlerSoapHeadersSBDM != null)
+ {
+ for (final QName soapHeader : handlerSoapHeadersSBDM)
+ {
+ handlerUMDM.addSoapHeader(soapHeader);
+ }
+ }
+
+ // translate handler soap roles
+ final Collection<String> handlerSoapRolesSBMD = handlerSBMD.getSoapRoles();
+ if (handlerSoapRolesSBMD != null)
+ {
+ for (final String soapRole : handlerSoapRolesSBMD)
+ {
+ handlerUMDM.addSoapRole(soapRole);
+ }
+ }
+
+ // translate handler port names
+ final Collection<String> handlerPortNamesSBMD = handlerSBMD.getPortNames();
+ if (handlerPortNamesSBMD != null)
+ {
+ for (final String portName : handlerPortNamesSBMD)
+ {
+ handlerUMDM.addPortName(portName);
+ }
+ }
+
+ return handlerUMDM;
+ }
+
+ /**
+ * Translates port component ref switchboard meta data to JBossWS unified port component ref meta data.
+ *
+ * @param serviceRefUMDM service ref unified meta data
+ * @param portComponentSBMD port component ref switchboard meta data
+ * @return port component ref unified meta data
+ */
+ private UnifiedPortComponentRefMetaData getUnifiedPortComponentRefMetaData(
+ final UnifiedServiceRefMetaData serviceRefUMDM, final PortComponent portComponentSBMD)
+ {
+ final UnifiedPortComponentRefMetaData portComponentUMDM = new UnifiedPortComponentRefMetaData(serviceRefUMDM);
+
+ // propagate service endpoint interface
+ portComponentUMDM.setServiceEndpointInterface(portComponentSBMD.getEndpointInterface());
+
+ // propagate MTOM properties
+ portComponentUMDM.setMtomEnabled(portComponentSBMD.isMtomEnabled());
+ portComponentUMDM.setMtomThreshold(portComponentSBMD.getMtomThreshold());
+
+ // propagate addressing properties
+ final Addressing addressingSBMD = portComponentSBMD.getAddressing();
+ if (addressingSBMD != null)
+ {
+ portComponentUMDM.setAddressingEnabled(addressingSBMD.isEnabled());
+ portComponentUMDM.setAddressingRequired(addressingSBMD.isRequired());
+ portComponentUMDM.setAddressingResponses(addressingSBMD.getResponses());
+ }
+
+ // propagate respect binding properties
+ portComponentUMDM.setRespectBindingEnabled(portComponentSBMD.isRespectBindingEnabled());
+
+ // propagate link
+ portComponentUMDM.setPortComponentLink(portComponentSBMD.getLink());
+
+ // propagate jboss specific MD
+ if (portComponentSBMD instanceof JBossPortComponent)
+ {
+ this.processUnifiedJBossPortComponentRefMetaData(portComponentUMDM, portComponentSBMD);
+ }
+
+ return portComponentUMDM;
+ }
+
+ /**
+ * Translates jboss port component ref switchboard meta data to JBossWS unified port component ref meta data.
+ *
+ * @param portComponentUMDM port component unified meta data
+ * @param portComponentSBMD port component switchboard meta data
+ */
+ private void processUnifiedJBossPortComponentRefMetaData(final UnifiedPortComponentRefMetaData portComponentUMDM,
+ final PortComponent portComponentSBMD)
+ {
+ final JBossPortComponent jbossPortComponentSBMD = (JBossPortComponent) portComponentSBMD;
+
+ // propagate port QName
+ portComponentUMDM.setPortQName(jbossPortComponentSBMD.getPortQName());
+
+ // propagate configuration properties
+ portComponentUMDM.setConfigName(jbossPortComponentSBMD.getConfigName());
+ portComponentUMDM.setConfigFile(jbossPortComponentSBMD.getConfigFile());
+
+ // propagate stub properties
+ final Map<String, String> stubPropertiesSBMD = jbossPortComponentSBMD.getStubProperties();
+ if (stubPropertiesSBMD != null)
+ {
+ for (final String propertyName : stubPropertiesSBMD.keySet())
+ {
+ final UnifiedStubPropertyMetaData stubPropertyUMDM = new UnifiedStubPropertyMetaData();
+ stubPropertyUMDM.setPropName(propertyName);
+ stubPropertyUMDM.setPropValue(stubPropertiesSBMD.get(propertyName));
+ portComponentUMDM.addStubProperty(stubPropertyUMDM);
+ }
+ }
+
+ // propagate call properties
+ final Map<String, String> callPropertiesSBMD = jbossPortComponentSBMD.getCallProperties();
+ if (callPropertiesSBMD != null)
+ {
+ for (final String propertyName : callPropertiesSBMD.keySet())
+ {
+ final UnifiedCallPropertyMetaData callPropertyUMDM = new UnifiedCallPropertyMetaData();
+ callPropertyUMDM.setPropName(propertyName);
+ callPropertyUMDM.setPropValue(callPropertiesSBMD.get(propertyName));
+ portComponentUMDM.addCallProperty(callPropertyUMDM);
+ }
+ }
+ }
+
+ /**
+ * Switchboard service ref resource.
+ */
+ private static final class ServiceRefResource implements Resource
+ {
+ private final Referenceable target;
+
+ private ServiceRefResource(final Referenceable target)
+ {
+ this.target = target;
+ }
+
+ @Override
+ public Object getDependency()
+ {
+ return null;
+ }
+
+ @Override
+ public Object getTarget()
+ {
+ return this.target;
+ }
+
+ @Override
+ public Collection<?> getInvocationDependencies()
+ {
+ return null;
+ }
+ }
+
+ private void processAnnotatedElement(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ this.processAddressingAnnotation(anElement, serviceRefUMDM);
+ this.processMTOMAnnotation(anElement, serviceRefUMDM);
+ this.processRespectBindingAnnotation(anElement, serviceRefUMDM);
+ this.processHandlerChainAnnotation(anElement, serviceRefUMDM);
+ this.processServiceRefType(anElement, serviceRefUMDM);
+ }
+
+ // TODO: use classloader to detect service ref type
+ private void processType(final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ final boolean isJAXRPC = serviceRefUMDM.getMappingFile() != null // TODO: is mappingFile check required?
+ || "javax.xml.rpc.Service".equals(serviceRefUMDM.getServiceInterface());
+
+ serviceRefUMDM.setType(isJAXRPC ? Type.JAXRPC : Type.JAXWS);
+ }
+
+ private void processAddressingAnnotation(final AnnotatedElement anElement,
+ final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ final javax.xml.ws.soap.Addressing addressingAnnotation = this.getAnnotation(anElement,
+ javax.xml.ws.soap.Addressing.class);
+
+ if (addressingAnnotation != null)
+ {
+ serviceRefUMDM.setAddressingAnnotationSpecified(true);
+ serviceRefUMDM.setAddressingEnabled(addressingAnnotation.enabled());
+ serviceRefUMDM.setAddressingRequired(addressingAnnotation.required());
+ serviceRefUMDM.setAddressingResponses(addressingAnnotation.responses().toString());
+ }
+ }
+
+ private void processMTOMAnnotation(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ final MTOM mtomAnnotation = this.getAnnotation(anElement, MTOM.class);
+
+ if (mtomAnnotation != null)
+ {
+ serviceRefUMDM.setMtomAnnotationSpecified(true);
+ serviceRefUMDM.setMtomEnabled(mtomAnnotation.enabled());
+ serviceRefUMDM.setMtomThreshold(mtomAnnotation.threshold());
+ }
+ }
+
+ private void processRespectBindingAnnotation(final AnnotatedElement anElement,
+ final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ final javax.xml.ws.RespectBinding respectBindingAnnotation = this.getAnnotation(anElement,
+ javax.xml.ws.RespectBinding.class);
+
+ if (respectBindingAnnotation != null)
+ {
+ serviceRefUMDM.setRespectBindingAnnotationSpecified(true);
+ serviceRefUMDM.setRespectBindingEnabled(respectBindingAnnotation.enabled());
+ }
+ }
+
+ private void processServiceRefType(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ if (anElement instanceof Field)
+ {
+ final Class<?> targetClass = ((Field) anElement).getType();
+ serviceRefUMDM.setServiceRefType(targetClass.getName());
+
+ if (Service.class.isAssignableFrom(targetClass))
+ serviceRefUMDM.setServiceInterface(targetClass.getName());
+ }
+ else if (anElement instanceof Method)
+ {
+ final Class<?> targetClass = ((Method) anElement).getParameterTypes()[0];
+ serviceRefUMDM.setServiceRefType(targetClass.getName());
+
+ if (Service.class.isAssignableFrom(targetClass))
+ serviceRefUMDM.setServiceInterface(targetClass.getName());
+ }
+ else
+ {
+ final WebServiceRef serviceRefAnnotation = this.getWebServiceRefAnnotation(anElement, serviceRefUMDM);
+ Class<?> targetClass = null;
+ if (serviceRefAnnotation != null && (serviceRefAnnotation.type() != Object.class))
+ {
+ targetClass = serviceRefAnnotation.type();
+ serviceRefUMDM.setServiceRefType(targetClass.getName());
+
+ if (Service.class.isAssignableFrom(targetClass))
+ serviceRefUMDM.setServiceInterface(targetClass.getName());
+ }
+ }
+ }
+
+ private void processHandlerChainAnnotation(final AnnotatedElement anElement,
+ final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ final javax.jws.HandlerChain handlerChainAnnotation = this.getAnnotation(anElement, javax.jws.HandlerChain.class);
+
+ if (handlerChainAnnotation != null)
+ {
+ // Set the handlerChain from @HandlerChain on the annotated element
+ String handlerChain = null;
+ if (handlerChainAnnotation.file().length() > 0)
+ handlerChain = handlerChainAnnotation.file();
+
+ // Resolve path to handler chain
+ if (handlerChain != null)
+ {
+ try
+ {
+ new URL(handlerChain);
+ }
+ catch (MalformedURLException ignored)
+ {
+ final Class<?> declaringClass = getDeclaringClass(anElement);
+
+ handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain;
+ }
+
+ serviceRefUMDM.setHandlerChain(handlerChain);
+ }
+ }
+ }
+
+ private Class<?> getDeclaringClass(final AnnotatedElement annotatedElement)
+ {
+ Class<?> declaringClass = null;
+ if (annotatedElement instanceof Field)
+ declaringClass = ((Field) annotatedElement).getDeclaringClass();
+ else if (annotatedElement instanceof Method)
+ declaringClass = ((Method) annotatedElement).getDeclaringClass();
+ else if (annotatedElement instanceof Class)
+ declaringClass = (Class<?>) annotatedElement;
+
+ return declaringClass;
+ }
+
+ private <T extends Annotation> T getAnnotation(final AnnotatedElement anElement, final Class<T> annotationClass)
+ {
+ return anElement != null ? (T) anElement.getAnnotation(annotationClass) : null;
+ }
+
+ private WebServiceRef getWebServiceRefAnnotation(final AnnotatedElement anElement,
+ final UnifiedServiceRefMetaData serviceRefUMDM)
+ {
+ final WebServiceRef webServiceRefAnnotation = this.getAnnotation(anElement, WebServiceRef.class);
+ final WebServiceRefs webServiceRefsAnnotation = this.getAnnotation(anElement, WebServiceRefs.class);
+
+ if (webServiceRefAnnotation == null && webServiceRefsAnnotation == null)
+ {
+ return null;
+ }
+
+ // Build the list of @WebServiceRef relevant annotations
+ final List<WebServiceRef> wsrefList = new ArrayList<WebServiceRef>();
+
+ if (webServiceRefAnnotation != null)
+ {
+ wsrefList.add(webServiceRefAnnotation);
+ }
+
+ if (webServiceRefsAnnotation != null)
+ {
+ for (final WebServiceRef webServiceRefAnn : webServiceRefsAnnotation.value())
+ {
+ wsrefList.add(webServiceRefAnn);
+ }
+ }
+
+ // Return effective @WebServiceRef annotation
+ WebServiceRef returnValue = null;
+ if (wsrefList.size() == 1)
+ {
+ returnValue = wsrefList.get(0);
+ }
+ else
+ {
+ for (WebServiceRef webServiceRefAnn : wsrefList)
+ {
+ if (serviceRefUMDM.getServiceRefName().endsWith(webServiceRefAnn.name()))
+ {
+ returnValue = webServiceRefAnn;
+ break;
+ }
+ }
+ }
+
+ return returnValue;
+ }
+
+ private AccessibleObject findInjectionTarget(ClassLoader loader, InjectionTarget target)
+ {
+ Class<?> clazz = null;
+ try
+ {
+ clazz = loader.loadClass(target.getTargetClass());
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new RuntimeException("<injection-target> class: " + target.getTargetClass()
+ + " was not found in deployment");
+ }
+
+ for (Field field : clazz.getDeclaredFields())
+ {
+ if (target.getTargetName().equals(field.getName()))
+ return field;
+ }
+
+ for (Method method : clazz.getDeclaredMethods())
+ {
+ if (method.getName().equals(target.getTargetName()))
+ return method;
+ }
+
+ throw new RuntimeException("<injection-target> could not be found: " + target.getTargetClass() + "."
+ + target.getTargetName());
+
+ }
+}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/VirtualFileAdaptor.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/VirtualFileAdaptor.java (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/VirtualFileAdaptor.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -0,0 +1,244 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webservices.integration.injection;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
+import java.io.OutputStream;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VFSUtils;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+import org.jboss.wsf.spi.deployment.WritableUnifiedVirtualFile;
+
+/**
+ * A VirtualFile adaptor.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Ales.Justin(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
+ */
+public final class VirtualFileAdaptor implements WritableUnifiedVirtualFile
+{
+ private static final long serialVersionUID = -4509594124653184348L;
+
+ private static final ObjectStreamField[] serialPersistentFields =
+ {
+ new ObjectStreamField("rootUrl", URL.class),
+ new ObjectStreamField("path", String.class),
+ new ObjectStreamField("requiresMount", boolean.class)
+ };
+
+ /** Minimal info to get full vfs file structure */
+ private URL rootUrl;
+ private String path;
+ private boolean requiresMount;
+ /** The virtual file */
+ private transient VirtualFile file;
+
+ public VirtualFileAdaptor(VirtualFile file)
+ {
+ this.file = file;
+ }
+
+ public VirtualFileAdaptor(URL rootUrl, String path)
+ {
+ this(rootUrl, path, false);
+ }
+
+ protected VirtualFileAdaptor(URL rootUrl, String path, boolean requiresMount)
+ {
+ if (rootUrl == null)
+ throw new IllegalArgumentException("Null root url");
+ if (path == null)
+ throw new IllegalArgumentException("Null path");
+
+ this.rootUrl = rootUrl;
+ this.path = path;
+ this.requiresMount = requiresMount;
+ }
+
+ /**
+ * Get the virtual file.
+ * Create file from root url and path if it doesn't exist yet.
+ *
+ * @return virtual file root
+ * @throws IOException for any error
+ */
+ protected VirtualFile getFile() throws IOException
+ {
+ if (file == null)
+ {
+ VirtualFile root;
+ try
+ {
+ root = VFS.getChild(rootUrl);
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IOException("Unable to get Virtualfile from URL: " + rootUrl, e);
+ }
+ file = root.getChild(path);
+
+ if (!file.exists())
+ {
+ throw new IOException("VirtualFile " + file + " does not exist");
+ }
+ else if (requiresMount && !isMounted(root, file))
+ {
+ throw new IOException("VirtualFile " + file + " is not mounted");
+ }
+ }
+ return file;
+ }
+
+ private static boolean isMounted(VirtualFile root, VirtualFile child) throws IOException
+ {
+ return !(root.getPathName().equals(root.getPhysicalFile().getAbsolutePath()) && child.getPathName().equals(child.getPhysicalFile().getAbsolutePath()));
+ }
+
+ public UnifiedVirtualFile findChild(String child) throws IOException
+ {
+ final VirtualFile virtualFile = getFile();
+ final VirtualFile childFile = file.getChild(child);
+ if(!childFile.exists())
+ throw new IOException("Child '" + child + "' not found for VirtualFile " + virtualFile);
+ return new VirtualFileAdaptor(childFile);
+ }
+
+ public URL toURL()
+ {
+ try
+ {
+ return getFile().toURL();
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+
+ public void writeContent(OutputStream bos) throws IOException
+ {
+ writeContent(bos, null);
+ }
+
+ public void writeContent(OutputStream bos, NameFilter filter) throws IOException
+ {
+ InputStream is = null;
+ try
+ {
+ is = getFile().openStream();
+ if (is instanceof JarInputStream)
+ {
+ JarInputStream jis = (JarInputStream)is;
+ JarOutputStream os = new JarOutputStream(bos);
+ JarEntry je = null;
+ while ((je = jis.getNextJarEntry()) != null)
+ {
+ if (filter != null && filter.accept(je.getName()))
+ {
+ os.putNextEntry(je);
+ VFSUtils.copyStream(jis, os);
+ }
+ }
+ VFSUtils.safeClose(os);
+ }
+ else
+ {
+ VFSUtils.copyStream(is, bos);
+ }
+ }
+ finally
+ {
+ VFSUtils.safeClose(is);
+ }
+ }
+
+ private void writeObject(ObjectOutputStream out) throws IOException, URISyntaxException
+ {
+ VirtualFile file = getFile();
+ URL url = rootUrl;
+ if (url == null)
+ {
+ VirtualFile parentFile = file.getParent();
+ url = parentFile != null ? parentFile.toURL() : null;
+ }
+ String pathName = path;
+ if (pathName == null)
+ pathName = file.getName();
+
+ ObjectOutputStream.PutField fields = out.putFields();
+ fields.put("rootUrl", url);
+ fields.put("path", pathName);
+
+ VirtualFile newRoot = VFS.getChild(url);
+ VirtualFile newChild = newRoot.getChild(pathName);
+ fields.put("requiresMount", isMounted(newRoot, newChild));
+
+ out.writeFields();
+ }
+
+ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream.GetField fields = in.readFields();
+ rootUrl = (URL) fields.get("rootUrl", null);
+ path = (String) fields.get("path", null);
+ requiresMount = fields.get("requiresMount", false);
+ }
+
+ public List<UnifiedVirtualFile> getChildren() throws IOException
+ {
+ List<VirtualFile> vfList = getFile().getChildren();
+ if (vfList == null)
+ return null;
+ List<UnifiedVirtualFile> uvfList = new LinkedList<UnifiedVirtualFile>();
+ for (VirtualFile vf : vfList)
+ {
+ uvfList.add(new VirtualFileAdaptor(vf));
+ }
+ return uvfList;
+ }
+
+ public String getName()
+ {
+ try
+ {
+ return getFile().getName();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/WebServiceContextResourceProvider.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/WebServiceContextResourceProvider.java (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/injection/WebServiceContextResourceProvider.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.webservices.integration.injection;
+
+import java.util.Collection;
+
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.switchboard.javaee.jboss.environment.JBossResourceEnvRefType;
+import org.jboss.switchboard.mc.spi.MCBasedResourceProvider;
+import org.jboss.switchboard.spi.Resource;
+import org.jboss.wsf.common.injection.ThreadLocalAwareWebServiceContext;
+
+/**
+ * WebServiceContext resource provider.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class WebServiceContextResourceProvider implements MCBasedResourceProvider<JBossResourceEnvRefType>
+{
+
+ @Override
+ public Resource provide(final DeploymentUnit unit, final JBossResourceEnvRefType resEnvRef)
+ {
+ return new WebServiceContextResource(ThreadLocalAwareWebServiceContext.getInstance());
+ }
+
+ @Override
+ public Class<JBossResourceEnvRefType> getEnvironmentEntryType()
+ {
+ return JBossResourceEnvRefType.class;
+ }
+
+ /**
+ * Switchboard web service context resource.
+ */
+ private static final class WebServiceContextResource implements Resource
+ {
+ private final WebServiceContext target;
+
+ private WebServiceContextResource(final WebServiceContext target)
+ {
+ this.target = target;
+ }
+
+ @Override
+ public Object getDependency()
+ {
+ return null;
+ }
+
+ @Override
+ public Object getTarget()
+ {
+ return this.target;
+ }
+
+ @Override
+ public Collection<?> getInvocationDependencies()
+ {
+ return null;
+ }
+ }
+}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -59,7 +59,6 @@
*/
final class InvocationHandlerEJB21 extends AbstractInvocationHandler
{
-
/** EJB21 JNDI name. */
private String jndiName;
@@ -74,14 +73,12 @@
*/
InvocationHandlerEJB21()
{
- super();
-
this.server = MBeanServerLocator.locateJBoss();
}
/**
* Initializes EJB 21 endpoint.
- *
+ *
* @param endpoint web service endpoint
*/
public void init(final Endpoint endpoint)
@@ -107,7 +104,7 @@
/**
* Gets EJB 21 container name lazily.
- *
+ *
* @param endpoint webservice endpoint
* @return EJB21 container name
*/
@@ -133,7 +130,7 @@
/**
* Invokes EJB 21 endpoint.
- *
+ *
* @param endpoint EJB 21 endpoint
* @param wsInvocation web service invocation
* @throws Exception if any error occurs
@@ -164,7 +161,7 @@
/**
* Returns configured EJB 21 JBoss MBean invocation.
- *
+ *
* @param wsInvocation webservice invocation
* @return configured JBoss invocation
*/
@@ -208,7 +205,7 @@
/**
* This method dynamically inserts EJB 21 webservice endpoint interceptor
* to the last but one position in EJB 21 processing chain. See [JBWS-756] for more info.
- *
+ *
* @param objectName EJB 21 object name
* @param ejbName EJB 21 short name
*/
@@ -244,5 +241,4 @@
this.log.warn("Cannot register EJB 21 service endpoint interceptor: ", ex);
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -22,22 +22,30 @@
package org.jboss.webservices.integration.invocation;
import java.lang.reflect.Method;
+import java.security.Principal;
import javax.naming.Context;
import javax.naming.NamingException;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceContext;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
import org.jboss.ejb3.EJBContainer;
+import org.jboss.ejb3.context.CurrentEJBContext;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.injection.ThreadLocalAwareWebServiceContext;
import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.integration.InvocationContextCallback;
import org.jboss.wsf.spi.invocation.integration.ServiceEndpointContainer;
import org.jboss.wsf.spi.ioc.IoCContainerProxy;
import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+import org.w3c.dom.Element;
/**
* Handles invocations on EJB3 endpoints.
@@ -64,8 +72,6 @@
*/
InvocationHandlerEJB3()
{
- super();
-
final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
final IoCContainerProxyFactory iocContainerFactory = spiProvider.getSPI(IoCContainerProxyFactory.class);
this.iocContainer = iocContainerFactory.getContainer();
@@ -73,7 +79,7 @@
/**
* Initializes EJB3 container name.
- *
+ *
* @param endpoint web service endpoint
*/
public void init(final Endpoint endpoint)
@@ -88,7 +94,7 @@
/**
* Gets EJB 3 container lazily.
- *
+ *
* @return EJB3 container
*/
private synchronized ServiceEndpointContainer getEjb3Container()
@@ -109,7 +115,7 @@
/**
* Invokes EJB 3 endpoint.
- *
+ *
* @param endpoint EJB 3 endpoint
* @param wsInvocation web service invocation
* @throws Exception if any error occurs
@@ -119,6 +125,7 @@
try
{
// prepare for invocation
+ this.onBeforeInvocation(wsInvocation);
final ServiceEndpointContainer ejbContainer = this.getEjb3Container();
final InvocationContextCallback invocationCallback = new EJB3InvocationContextCallback(wsInvocation);
final Class<?> implClass = ejbContainer.getServiceImplementationClass();
@@ -135,26 +142,100 @@
this.log.error("Method invocation failed with exception: " + t.getMessage(), t);
this.handleInvocationException(t);
}
+ finally
+ {
+ this.onAfterInvocation(wsInvocation);
+ }
}
-
+
public Context getJNDIContext(final Endpoint ep) throws NamingException
{
- final EJBContainer ejb3Container = (EJBContainer)getEjb3Container();
- return (Context)ejb3Container.getEnc().lookup(EJB3_JNDI_PREFIX);
+ final EJBContainer ejb3Container = (EJBContainer) getEjb3Container();
+ return (Context) ejb3Container.getEnc().lookup(EJB3_JNDI_PREFIX);
}
/**
+ * Injects webservice context on target bean.
+ *
+ * @param invocation current invocation
+ */
+ @Override
+ public void onBeforeInvocation(final Invocation invocation)
+ {
+ final WebServiceContext wsContext = this.getWebServiceContext(invocation);
+ ThreadLocalAwareWebServiceContext.getInstance().setMessageContext(wsContext);
+ }
+
+ /**
+ * Cleanups injected webservice context on target bean.
+ *
+ * @param invocation current invocation
+ */
+ @Override
+ public void onAfterInvocation(final Invocation invocation)
+ {
+ ThreadLocalAwareWebServiceContext.getInstance().setMessageContext(null);
+ }
+
+ /**
+ * Returns WebServiceContext associated with this invocation.
+ *
+ * @param invocation current invocation
+ * @return web service context or null if not available
+ */
+ private WebServiceContext getWebServiceContext(final Invocation invocation)
+ {
+ final InvocationContext invocationContext = invocation.getInvocationContext();
+
+ return new WebServiceContextAdapter(invocationContext.getAttachment(WebServiceContext.class));
+ }
+
+ private static final class WebServiceContextAdapter implements WebServiceContext
+ {
+ private final WebServiceContext delegate;
+
+ private WebServiceContextAdapter(final WebServiceContext delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public MessageContext getMessageContext()
+ {
+ return this.delegate.getMessageContext();
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return CurrentEJBContext.get().getCallerPrincipal();
+ }
+
+ public boolean isUserInRole(final String role)
+ {
+ return CurrentEJBContext.get().isCallerInRole(role);
+ }
+
+ public EndpointReference getEndpointReference(final Element... referenceParameters)
+ {
+ return delegate.getEndpointReference(referenceParameters);
+ }
+
+ public <T extends EndpointReference> T getEndpointReference(final Class<T> clazz, final Element... referenceParameters)
+ {
+ return delegate.getEndpointReference(clazz, referenceParameters);
+ }
+ }
+
+ /**
* EJB3 invocation callback allowing EJB 3 beans to access Web Service invocation properties.
*/
private static final class EJB3InvocationContextCallback implements InvocationContextCallback
{
-
/** WebService invocation. */
private Invocation wsInvocation;
/**
* Constructor.
- *
+ *
* @param wsInvocation delegee
*/
public EJB3InvocationContextCallback(final Invocation wsInvocation)
@@ -164,7 +245,7 @@
/**
* Retrieves attachment type from Web Service invocation context attachments.
- *
+ *
* @param <T> attachment type
* @param attachmentType attachment class
* @return attachment value
@@ -173,7 +254,5 @@
{
return this.wsInvocation.getInvocationContext().getAttachment(attachmentType);
}
-
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -35,7 +35,6 @@
*/
public final class InvocationHandlerFactoryImpl extends InvocationHandlerFactory
{
-
/**
* Constructor.
*/
@@ -46,7 +45,7 @@
/**
* Returns invocation handler associated with invocation type.
- *
+ *
* @param type invocation type
* @return invocation handler
*/
@@ -80,5 +79,4 @@
return handler;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -31,7 +31,6 @@
*/
final class InvocationHandlerMDB21 extends AbstractInvocationHandlerJSE
{
-
/**
* Constructor.
*/
@@ -39,5 +38,4 @@
{
super();
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -31,7 +31,6 @@
*/
final class InvocationHandlerMDB3 extends AbstractInvocationHandlerJSE
{
-
/**
* Constructor.
*/
@@ -39,5 +38,4 @@
{
super();
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/ServiceEndpointInterceptorEJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/ServiceEndpointInterceptorEJB21.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/invocation/ServiceEndpointInterceptorEJB21.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -31,16 +31,15 @@
/**
* This Interceptor does the ws4ee handler processing on EJB 21 endpoints.
- *
+ *
* According to the ws4ee spec the handler logic must be invoked after the container
- * applied method level security to the invocation.
+ * applied method level security to the invocation.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
final class ServiceEndpointInterceptorEJB21 extends AbstractInterceptor
{
-
/**
* Constructor.
*/
@@ -51,7 +50,7 @@
/**
* Before and after we call the EJB 21 service endpoint bean, we process the handler chains.
- *
+ *
* @param jbossInvocation jboss invocation
* @return ws invocation return value
* @throws Exception if any error occurs
@@ -120,5 +119,4 @@
throw ex;
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -31,7 +31,6 @@
*/
public final class IoCContainerProxyFactoryImpl implements IoCContainerProxyFactory
{
-
/** Container proxy singleton. */
private static final IoCContainerProxy CONTAINER = IoCContainerProxyImpl.getInstance();
@@ -45,12 +44,11 @@
/**
* @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory#getContainer()
- *
+ *
* @return IoC container proxy
*/
public IoCContainerProxy getContainer()
{
return IoCContainerProxyFactoryImpl.CONTAINER;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -33,7 +33,6 @@
*/
public final class IoCContainerProxyImpl implements IoCContainerProxy
{
-
/** Singleton. */
private static final IoCContainerProxy SINGLETON = new IoCContainerProxyImpl();
/** JBoss MC kernel. */
@@ -46,7 +45,7 @@
{
super();
}
-
+
/**
* Returns container proxy instance.
*
@@ -56,10 +55,10 @@
{
return IoCContainerProxyImpl.SINGLETON;
}
-
+
/**
* Sets JBoss kernel - invoked via MC injection.
- *
+ *
* @param kernel JBoss kernel
*/
public void setKernel(final Kernel kernel)
@@ -84,5 +83,4 @@
return (T)ctx.getTarget();
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/AbstractMetaDataBuilderEJB.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -44,13 +44,12 @@
*/
abstract class AbstractMetaDataBuilderEJB
{
-
/** Logger. */
protected final Logger log = Logger.getLogger(this.getClass());
/**
* Builds universal EJB meta data model that is AS agnostic.
- *
+ *
* @param dep webservice deployment
* @return universal EJB meta data model
*/
@@ -68,7 +67,7 @@
/**
* Template method for build enterprise beans meta data.
- *
+ *
* @param dep webservice deployment
* @param ejbMetaData universal EJB meta data model
*/
@@ -82,7 +81,7 @@
* <li>config name</li>
* <li>config file</li>
* </ul>
- *
+ *
* @param dep webservice deployment
* @param ejbArchiveMD universal EJB meta data model
*/
@@ -151,5 +150,4 @@
return false;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -35,7 +35,6 @@
*/
public final class ContainerMetaDataDeploymentAspect extends AbstractDeploymentAspect
{
-
/** JSE meta data builder. */
private final MetaDataBuilderJSE metaDataBuilderJSE = new MetaDataBuilderJSE();
@@ -55,7 +54,7 @@
/**
* Build container independent meta data.
- *
+ *
* @param dep webservice deployment
*/
@Override
@@ -80,5 +79,4 @@
dep.addAttachment(EJBArchiveMetaData.class, ejbMetaData);
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB21.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB21.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -45,7 +45,6 @@
*/
final class MetaDataBuilderEJB21 extends AbstractMetaDataBuilderEJB
{
-
/**
* Constructor.
*/
@@ -80,7 +79,7 @@
/**
* Builds JBoss agnostic EJB meta data.
- *
+ *
* @param wsEjbsMD jboss agnostic EJBs meta data
* @param jbossEjbMD jboss specific EJB meta data
*/
@@ -154,5 +153,4 @@
return null;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB3.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderEJB3.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -46,7 +46,6 @@
*/
final class MetaDataBuilderEJB3 extends AbstractMetaDataBuilderEJB
{
-
/**
* Constructor.
*/
@@ -57,7 +56,7 @@
/**
* @see AbstractMetaDataBuilderEJB#buildEnterpriseBeansMetaData(Deployment, EJBArchiveMetaData)
- *
+ *
* @param dep webservice deployment
* @param ejbArchiveMD EJB archive meta data
*/
@@ -77,7 +76,7 @@
/**
* Builds JBoss agnostic EJB meta data.
- *
+ *
* @param wsEjbsMD jboss agnostic EJBs meta data
* @param jbossEjbMD jboss specific EJB meta data
*/
@@ -142,7 +141,7 @@
/**
* Returns activation config property value or null if not found.
- *
+ *
* @param name activation property name
* @param activationConfigProperties activation config properties
* @return activation config property value
@@ -162,5 +161,4 @@
return null;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderJSE.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderJSE.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/MetaDataBuilderJSE.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -51,14 +51,13 @@
import org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter;
/**
- * Builds container independent meta data from WEB container meta data.
+ * Builds container independent meta data from WEB container meta data.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
final class MetaDataBuilderJSE
{
-
/** Logger. */
private final Logger log = Logger.getLogger(MetaDataBuilderJSE.class);
@@ -72,7 +71,7 @@
/**
* Builds universal JSE meta data model that is AS agnostic.
- *
+ *
* @param dep webservice deployment
* @return universal JSE meta data model
*/
@@ -152,7 +151,7 @@
/**
* Builds security meta data.
- *
+ *
* @param securityConstraintsMD security constraints meta data
* @return universal JSE security meta data model
*/
@@ -181,7 +180,7 @@
/**
* Sets web resources in universal meta data model.
- *
+ *
* @param jseSecurityMD universal JSE security meta data model
* @param securityConstraintMD security constraint meta data
*/
@@ -203,7 +202,7 @@
/**
* Returns servlet name to url pattern mappings.
- *
+ *
* @param jbossWebMD jboss web meta data
* @return servlet name to url pattern mappings
*/
@@ -225,7 +224,7 @@
/**
* Returns servlet name to servlet class mappings.
- *
+ *
* @param jbossWebMD jboss web meta data
* @return servlet name to servlet mappings
*/
@@ -258,7 +257,7 @@
* If there's application.xml descriptor provided defining nested web module,
* then context root defined there will be returned.
* Otherwise context root defined in jboss-web.xml will be returned.
- *
+ *
* @param dep webservice deployment
* @param jbossWebMD jboss web meta data
* @return context root
@@ -284,5 +283,4 @@
// prefer context root defined in application.xml over one defined in jboss-web.xml
return contextRoot != null ? contextRoot : jbossWebMD.getContextRoot();
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/PublishLocationAdapterImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/PublishLocationAdapterImpl.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/metadata/PublishLocationAdapterImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -33,13 +33,12 @@
*/
final class PublishLocationAdapterImpl implements PublishLocationAdapter
{
-
/** Webservice descriptions meta data. */
private final WebserviceDescriptionsMetaData wsDescriptionsMD;
/**
* Constructor.
- *
+ *
* @param wsDescriptionsMD webservice descriptions meta data
*/
PublishLocationAdapterImpl(final WebserviceDescriptionsMetaData wsDescriptionsMD)
@@ -51,7 +50,7 @@
/**
* @see org.jboss.wsf.spi.metadata.j2ee.PublishLocationAdapter#getWsdlPublishLocationByName(String)
- *
+ *
* @param endpointName endpoint name
* @return publish location
*/
@@ -69,5 +68,4 @@
return null;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -31,17 +31,16 @@
import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
- * Generates JACC permissions. (This is temporary and really hacky solution).
- *
- * TODO: remove this deployment aspect and update
- * particular JACC deployer to execute after
- * JBossWS has modified web meta data.
+ * Generates JACC permissions. (This is temporary and really hacky solution).
*
+ * TODO: remove this deployment aspect and update
+ * particular JACC deployer to execute after
+ * JBossWS has modified web meta data.
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public final class JACCPermissionsDeploymentAspect extends AbstractDeploymentAspect
{
-
/**
* Constructor.
*/
@@ -55,7 +54,7 @@
* does not go through the war security deployer. Hence the JACC
* permissions are not created. There is a need to explicitly create
* the war jacc permissions.
- *
+ *
* @param dep webservice deployment
*/
@Override
@@ -78,5 +77,4 @@
throw new RuntimeException("Exception generating JACC perms: ", e);
}
}
-
}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorImpl.java (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -0,0 +1,67 @@
+/*
+ * 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.webservices.integration.security;
+
+import java.security.Key;
+import java.security.KeyStore;
+import java.util.Properties;
+
+import org.jboss.wsf.spi.security.JAASSecurityDomainAdaptor;
+import org.jboss.security.plugins.JaasSecurityDomain;
+
+/**
+ * Adapt JaasSecurityDomain to jbossws spi
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 14-Dec-2010
+ *
+ */
+public class JaasSecurityDomainAdaptorImpl implements JAASSecurityDomainAdaptor
+{
+ private JaasSecurityDomain delegate;
+
+ public JaasSecurityDomainAdaptorImpl(JaasSecurityDomain delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public KeyStore getKeyStore()
+ {
+ return delegate.getKeyStore();
+ }
+
+ public KeyStore getTrustStore()
+ {
+ return delegate.getTrustStore();
+ }
+
+ public Properties getAdditionalOptions()
+ {
+ return delegate.getAdditionalOptions();
+ }
+
+ public Key getKey(String alias, String serviceAuthToken) throws Exception
+ {
+ return delegate.getKey(alias, serviceAuthToken);
+ }
+
+}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorResolverImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorResolverImpl.java (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/JaasSecurityDomainAdaptorResolverImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -0,0 +1,72 @@
+/*
+ * 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.webservices.integration.security;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.logging.Logger;
+import org.jboss.security.plugins.JaasSecurityDomain;
+import org.jboss.wsf.spi.security.JAASSecurityDomainAdaptor;
+import org.jboss.wsf.spi.security.JAASSecurityDomainAdaptorResolver;
+
+/**
+ * Lookup JAASSecurityAdaptor from given JNDI location
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 14-Dec-2010
+ */
+public class JaasSecurityDomainAdaptorResolverImpl implements JAASSecurityDomainAdaptorResolver
+{
+ public JAASSecurityDomainAdaptor lookup(String jndi) throws Exception
+ {
+ InitialContext ic = null;
+ try
+ {
+ ic = new InitialContext();
+ Object o = ic.lookup(jndi);
+ if (!(o instanceof JaasSecurityDomain))
+ {
+ throw new Exception(jndi + " not bound to a JaasSecurityDomain but to a " + o.getClass().getName() + " instance");
+ }
+ return new JaasSecurityDomainAdaptorImpl((JaasSecurityDomain)o);
+ }
+ catch (NamingException e)
+ {
+ throw new Exception("JNDI failure handling " + jndi, e);
+ }
+ finally
+ {
+ if (ic != null)
+ {
+ try
+ {
+ ic.close();
+ }
+ catch (NamingException e)
+ {
+ Logger.getLogger(JaasSecurityDomainAdaptorImpl.class).warn(this + " failed to close InitialContext", e);
+ }
+ }
+ }
+ }
+}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterFactoryImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterFactoryImpl.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterFactoryImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -26,13 +26,12 @@
/**
* Security adapters factory.
- *
+ *
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
public final class SecurityAdapterFactoryImpl extends SecurityAdaptorFactory
{
-
/**
* Constructor.
*/
@@ -43,12 +42,11 @@
/**
* Creates new security adapter instance.
- *
+ *
* @return security adapter
*/
public SecurityAdaptor newSecurityAdapter()
{
return new SecurityAdapterImpl();
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterImpl.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterImpl.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/security/SecurityAdapterImpl.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -40,7 +40,6 @@
*/
final class SecurityAdapterImpl implements SecurityAdaptor
{
-
/**
* Constructor.
*/
@@ -51,7 +50,7 @@
/**
* @see org.jboss.wsf.spi.invocation.SecurityAdaptor#getPrincipal()
- *
+ *
* @return principal
*/
public Principal getPrincipal()
@@ -61,7 +60,7 @@
/**
* @see org.jboss.wsf.spi.invocation.SecurityAdaptor#setPrincipal(Principal)
- *
+ *
* @param principal principal
*/
public void setPrincipal(final Principal principal)
@@ -71,7 +70,7 @@
/**
* @see org.jboss.wsf.spi.invocation.SecurityAdaptor#getCredential()
- *
+ *
* @return credential
*/
public Object getCredential()
@@ -81,7 +80,7 @@
/**
* @see org.jboss.wsf.spi.invocation.SecurityAdaptor#setCredential(Object)
- *
+ *
* @param credential credential
*/
public void setCredential(final Object credential)
@@ -91,7 +90,7 @@
/**
* @see org.jboss.wsf.spi.invocation.SecurityAdaptor#pushSubjectContext(Subject, Principal, Object)
- *
+ *
* @param subject subject
* @param principal principal
* @param credential credential
@@ -115,5 +114,4 @@
}
});
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/AbstractSecurityMetaDataAccessorEJB.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/AbstractSecurityMetaDataAccessorEJB.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/AbstractSecurityMetaDataAccessorEJB.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -36,7 +36,6 @@
*/
abstract class AbstractSecurityMetaDataAccessorEJB implements SecurityMetaDataAccessorEJB
{
-
/** JAAS JNDI prefix. */
private static final String JAAS_JNDI_PREFIX = "java:/jaas/";
@@ -126,5 +125,4 @@
return ejbMD != null ? ejbMD.getSecurityMetaData() : null;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -33,7 +33,6 @@
*/
interface SecurityMetaDataAccessorEJB
{
-
/**
* Obtains security domain from EJB deployment.
*
@@ -73,5 +72,4 @@
* @return transport guarantee or null if not specified
*/
String getTransportGuarantee(Endpoint endpoint);
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB21.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB21.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB21.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -29,14 +29,13 @@
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
/**
- * Creates web app security meta data for EJB 21 deployment.
+ * Creates web app security meta data for EJB 21 deployment.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
final class SecurityMetaDataAccessorEJB21 extends AbstractSecurityMetaDataAccessorEJB
{
-
/**
* Constructor.
*/
@@ -71,5 +70,4 @@
return (assemblyDescriptorMD != null) ? assemblyDescriptorMD.getSecurityRoles() : null;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB3.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB3.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/SecurityMetaDataAccessorEJB3.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -43,7 +43,6 @@
*/
final class SecurityMetaDataAccessorEJB3 extends AbstractSecurityMetaDataAccessorEJB
{
-
/**
* Constructor.
*/
@@ -152,8 +151,8 @@
/**
* Gets <b>WebContext</b> if associated with EJB endpoint.
- *
- * @param endpoint EJB webservice endpoint
+ *
+ * @param endpoint EJB webservice endpoint
* @return web context associated with EJB or null
*/
@SuppressWarnings(
@@ -208,5 +207,4 @@
throw new IllegalStateException(errorMessage + firstDomain + secondDomain);
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -26,14 +26,13 @@
import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
- * A deployment aspect that generates web app meta data for EJB endpoints.
+ * A deployment aspect that generates web app meta data for EJB endpoints.
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
*/
public final class WebMetaDataCreatingDeploymentAspect extends AbstractDeploymentAspect
{
-
/** Web meta data creator. */
private WebMetaDataCreator webMetaDataCreator = new WebMetaDataCreator();
@@ -61,5 +60,4 @@
this.webMetaDataCreator.create(dep);
}
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -46,7 +46,6 @@
*/
final class WebMetaDataCreator
{
-
/** Our Realm. */
private static final String EJB_WEBSERVICE_REALM = "EJBWebServiceEndpointServlet Realm";
@@ -78,7 +77,7 @@
JBossWebMetaData jbossWebMD = ASHelper.getOptionalAttachment(unit, JBossWebMetaData.class);
if (jbossWebMD == null)
{
- jbossWebMD = new JBossWebMetaData();
+ jbossWebMD = new JBossWebMetaData();
}
this.createWebAppDescriptor(dep, jbossWebMD);
@@ -368,5 +367,4 @@
return isJaxws ? this.ejb3SecurityAccessor : this.ejb21SecurityAccessor;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifier.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -45,7 +45,6 @@
*/
final class WebMetaDataModifier
{
-
/** Logger. */
private final Logger log = Logger.getLogger(WebMetaDataModifier.class);
@@ -136,7 +135,7 @@
log.warn("Cannot get transport class name from " + WSConstants.STACK_TRANSPORT_CLASS_PROVIDER, e);
}
}
-
+
if (transportClassName == null)
{
transportClassName = (String) dep.getProperty(WSConstants.STACK_TRANSPORT_CLASS);
@@ -149,5 +148,4 @@
return transportClassName;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifyingDeploymentAspect.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifyingDeploymentAspect.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifyingDeploymentAspect.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -32,7 +32,6 @@
*/
public final class WebMetaDataModifyingDeploymentAspect extends AbstractDeploymentAspect
{
-
/** Web meta data modifier. */
private WebMetaDataModifier webMetaDataModifier = new WebMetaDataModifier();
@@ -55,5 +54,4 @@
this.log.debug("Modifying web meta data for webservice deployment: " + dep.getSimpleName());
this.webMetaDataModifier.modify(dep);
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/ASHelper.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -47,8 +47,7 @@
*/
public final class ASHelper
{
-
- /**
+ /**
* EJB invocation property.
*/
public static final String CONTAINER_NAME = "org.jboss.wsf.spi.invocation.ContainerName";
@@ -231,7 +230,7 @@
/**
* Returns true if EJB container is webservice endpoint.
- *
+ *
* @param ejbContainerAdapter EJB container adapter
* @return true if EJB container is webservice endpoint, false otherwise
*/
@@ -258,7 +257,7 @@
/**
* Returns servlet meta data for requested servlet name.
- *
+ *
* @param jbossWebMD jboss web meta data
* @param servletName servlet name
* @return servlet meta data
@@ -310,12 +309,12 @@
}
/**
- * Returns required attachment value from deployment unit.
- *
+ * Returns required attachment value from deployment unit.
+ *
* @param <A> expected value
* @param unit deployment unit
* @param key attachment key
- * @return required attachment
+ * @return required attachment
* @throws IllegalStateException if attachment value is null
*/
public static <A> A getRequiredAttachment(final DeploymentUnit unit, final Class<A> key)
@@ -332,11 +331,11 @@
/**
* Returns optional attachment value from deployment unit or null if not bound.
- *
+ *
* @param <A> expected value
* @param unit deployment unit
* @param key attachment key
- * @return optional attachment value or null
+ * @return optional attachment value or null
*/
public static <A> A getOptionalAttachment(final DeploymentUnit unit, final Class<A> key)
{
@@ -345,7 +344,7 @@
/**
* Returns true if deployment unit have attachment value associated with the <b>key</b>.
- *
+ *
* @param unit deployment unit
* @param key attachment key
* @return true if contains attachment, false otherwise
@@ -415,5 +414,4 @@
return endpoints;
}
-
}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/WebMetaDataHelper.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/WebMetaDataHelper.java 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/util/WebMetaDataHelper.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -47,7 +47,6 @@
*/
public final class WebMetaDataHelper
{
-
/** Star utility string. */
private static final String STAR_STRING = "*";
@@ -420,5 +419,4 @@
return paramMD;
}
-
}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldDeploymentAspect.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservices.integration.weld;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.weld.integration.deployer.DeployersUtils;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.common.integration.WSHelper;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+/**
+ * Weld deployment aspect that associates Weld Invocation handler
+ * if WS CDI integration is detected.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class WeldDeploymentAspect extends AbstractDeploymentAspect
+{
+
+ public WeldDeploymentAspect()
+ {
+ // does nothing
+ }
+
+ @Override
+ public void start(final Deployment dep)
+ {
+ if (!WSHelper.isJaxwsJseDeployment(dep))
+ {
+ // we support weld integration for JAXWS JSE endpoints only
+ return;
+ }
+
+ final DeploymentUnit deploymentUnit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
+ if (this.isWeldDeployment(deploymentUnit))
+ {
+ for (final Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ endpoint.setInvocationHandler(new WeldInvocationHandler(endpoint.getInvocationHandler()));
+ }
+ }
+ }
+
+ private boolean isWeldDeployment(final DeploymentUnit unit)
+ {
+ return unit.getAttachment(DeployersUtils.WELD_FILES) != null;
+ }
+
+}
Added: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/weld/WeldInvocationHandler.java 2011-01-11 14:08:22 UTC (rev 13550)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservices.integration.weld;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.weld.integration.injection.NonContextualObjectInjectionHelper;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+
+/**
+ * Weld invocation handler.
+ *
+ * @author <a href="maito:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:mariusb@redhat.com">Marius Bogoevici</a>
+ */
+public final class WeldInvocationHandler extends AbstractInvocationHandlerJSE
+{
+
+ private static final String BEAN_MANAGER_JNDI_NAME = "java:comp/BeanManager";
+
+ private final InvocationHandler delegate;
+
+ public WeldInvocationHandler(final InvocationHandler delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation) throws Exception
+ {
+ // handle Weld injections first
+ this.handleWeldInjection(invocation.getInvocationContext().getTargetBean());
+ // handle JBossWS injections last and call @PostConstruct annotated methods
+ this.delegate.onEndpointInstantiated(endpoint, invocation);
+ }
+
+ @Override
+ public void onBeforeInvocation(final Invocation invocation) throws Exception
+ {
+ this.delegate.onBeforeInvocation(invocation);
+ }
+
+ @Override
+ public void onAfterInvocation(final Invocation invocation) throws Exception
+ {
+ this.delegate.onAfterInvocation(invocation);
+ }
+
+ /**
+ * Handles weld injection.
+ *
+ * @param instance to operate upon
+ */
+ private void handleWeldInjection(final Object instance)
+ {
+ try {
+ WeldManager beanManager = (WeldManager) new InitialContext().lookup(BEAN_MANAGER_JNDI_NAME);
+ NonContextualObjectInjectionHelper.injectNonContextualInstance(instance, beanManager);
+ } catch (NamingException e) {
+ throw new IllegalStateException("Unable to locate BeanManager");
+ }
+ }
+
+}
Modified: container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-01-11 12:13:33 UTC (rev 13549)
+++ container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2011-01-11 14:08:22 UTC (rev 13550)
@@ -2,6 +2,18 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <!-- processes @WebServiceRef resources and their DD equivalents (EE.5.6 of Java EE6 spec) -->
+ <bean
+ name="org.jboss.switchboard.WebServiceRefResourceProvider"
+ class="org.jboss.webservices.integration.injection.ServiceRefResourceProvider"
+ />
+
+ <!-- processes @Resource annotated WebServiceContext beans (EE.5.6 of Java EE6 spec) -->
+ <bean
+ name="org.jboss.switchboard.WebServiceContextResourceProvider"
+ class="org.jboss.webservices.integration.injection.WebServiceContextResourceProvider"
+ />
+
<!-- Wraps single instance of the kernel -->
<bean name="WSIoCContainerProxy" class="org.jboss.webservices.integration.ioc.IoCContainerProxyImpl">
<property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
@@ -49,13 +61,13 @@
<!-- deployers -->
<bean name="WSDescriptorDeployer" class="org.jboss.webservices.integration.deployers.WSDescriptorDeployer">
- <incallback method="setProcessor"/>
+ <incallback method="setParser"/>
</bean>
-
+
<bean name="JMSDescriptorDeployer" class="org.jboss.webservices.integration.deployers.JMSDescriptorDeployer">
- <incallback method="setProcessor"/>
+ <incallback method="setParser"/>
</bean>
-
+
<bean name="WSEJBAdapterDeployer" class="org.jboss.webservices.integration.deployers.WSEJBAdapterDeployer"/>
<bean name="WSTypeDeployer" class="org.jboss.webservices.integration.deployers.WSTypeDeployer"/>
@@ -72,7 +84,7 @@
<incallback method="addDeployer"/>
<uncallback method="removeDeployer"/>
</bean>
-
+
<!-- The AS specific deployment aspects -->
<bean name="WSContainerMetaDataDeploymentAspect" class="org.jboss.webservices.integration.metadata.ContainerMetaDataDeploymentAspect">
<property name="provides">ContainerMetaData, VFSRoot</property>
@@ -81,7 +93,7 @@
<bean name="WSInjectionMetaDataDeploymentAspect" class="org.jboss.webservices.integration.injection.InjectionMetaDataDeploymentAspect">
<property name="requires">WebMetaData</property>
<property name="provides">InjectionMetaData</property>
- <property name="ejbReferenceResolver"><inject bean="org.jboss.ejb3.EjbReferenceResolver"/></property>
+ <property name="ejbReferenceResolver"><inject bean="org.jboss.ejb3.ejbref.resolver.EjbReferenceResolver"/></property>
</bean>
<!-- TODO: remove this hacky aspect -->
@@ -139,4 +151,9 @@
<property name="provides">WebMetaData</property>
</bean>
+ <bean name="WSWeldDeploymentAspect" class="org.jboss.webservices.integration.weld.WeldDeploymentAspect">
+ <property name="requires">StackEndpointHandler</property>
+ <property name="provides">CDIInjection</property>
+ </bean>
+
</deployment>
Added: container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.security.JAASSecurityDomainAdaptorResolver
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.security.JAASSecurityDomainAdaptorResolver (rev 0)
+++ container/jboss60/branches/jbossws-jboss600/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.security.JAASSecurityDomainAdaptorResolver 2011-01-11 14:08:22 UTC (rev 13550)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.security.JaasSecurityDomainAdaptorResolverImpl
\ No newline at end of file
13 years, 11 months
JBossWS SVN: r13549 - container/jboss60/branches.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 07:13:33 -0500 (Tue, 11 Jan 2011)
New Revision: 13549
Added:
container/jboss60/branches/jbossws-jboss600/
Removed:
container/jboss60/branches/jbossws-jboss600M5/
Log:
moving sources to new location
Copied: container/jboss60/branches/jbossws-jboss600 (from rev 13548, container/jboss60/branches/jbossws-jboss600M5)
13 years, 11 months
JBossWS SVN: r13548 - framework/trunk/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 05:54:07 -0500 (Tue, 11 Jan 2011)
New Revision: 13548
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
Log:
completely removing log message
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java 2011-01-11 07:55:32 UTC (rev 13547)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java 2011-01-11 10:54:07 UTC (rev 13548)
@@ -30,7 +30,7 @@
/**
* DefaultHttpEndpoint implementation
- *
+ *
* @author <a href="ema(a)redhat.com">Jim Ma</a>
*/
public class DefaultHttpEndpoint extends AbstractDefaultEndpoint implements HttpEndpoint
@@ -42,7 +42,7 @@
{
super(targetBean);
}
-
+
public EndpointMetrics getEndpointMetrics()
{
return metrics;
@@ -55,7 +55,7 @@
this.metrics = metrics;
}
-
+
public String getURLPattern()
{
return urlPattern;
@@ -66,20 +66,20 @@
assertEndpointSetterAccess();
this.urlPattern = urlPattern;
}
-
+
public Context getJNDIContext()
{
Context retVal = null;
-
+
try
{
retVal = getInvocationHandler().getJNDIContext(this);
}
catch (NamingException e)
{
- log.warn("JNDI not available neither in JSE environment nor in SAR archives.", e);
+ // JNDI not available neither in JSE environment nor in SAR archives
}
-
+
return retVal;
}
13 years, 11 months
JBossWS SVN: r13547 - framework/trunk/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-01-11 02:55:32 -0500 (Tue, 11 Jan 2011)
New Revision: 13547
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
Log:
changing log level from error to warning
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java 2011-01-05 15:09:37 UTC (rev 13546)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java 2011-01-11 07:55:32 UTC (rev 13547)
@@ -77,7 +77,7 @@
}
catch (NamingException e)
{
- log.error("JNDI not available neither in JSE environment nor in SAR archives.", e);
+ log.warn("JNDI not available neither in JSE environment nor in SAR archives.", e);
}
return retVal;
13 years, 11 months
JBossWS SVN: r13546 - framework/trunk/hudson/hudson-home.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-01-05 10:09:37 -0500 (Wed, 05 Jan 2011)
New Revision: 13546
Modified:
framework/trunk/hudson/hudson-home/config.xml
Log:
Updating main hudson config after AS 6 final release
Modified: framework/trunk/hudson/hudson-home/config.xml
===================================================================
--- framework/trunk/hudson/hudson-home/config.xml 2011-01-05 11:37:13 UTC (rev 13545)
+++ framework/trunk/hudson/hudson-home/config.xml 2011-01-05 15:09:37 UTC (rev 13546)
@@ -13,6 +13,7 @@
<tr><th align=left>Stack-CXF:</th><td>@hudson.cxf.url@</td></tr>
<tr><td colspan=2></td></tr>
<tr><th align=left>@hudson.jboss600.build@</th><td>-r(a)hudson.jboss600.rev@ @hudson.jboss600.url@</td></tr>
+ <tr><th align=left>@hudson.jboss601.build@</th><td>-r(a)hudson.jboss601.rev@ @hudson.jboss601.url@</td></tr>
<tr><td colspan=2></td></tr>
</table>
]]>
@@ -29,6 +30,7 @@
<no-comparator/>
<string>AS-ALL</string>
<string>AS-6.0.0</string>
+ <string>AS-6.0.1</string>
</jobNames>
<name>AS Builds</name>
<description>
@@ -45,6 +47,7 @@
<no-comparator/>
<string>AS-TESTS-ALL</string>
<string>AS-TESTS-AS-6.0.0</string>
+ <string>AS-TESTS-AS-6.0.1</string>
</jobNames>
<name>AS Tests</name>
<description>
@@ -66,6 +69,9 @@
<string>NATIVE-CORE-AS-6.0.0-SUN-JDK-6</string>
<string>NATIVE-BINDIST-AS-6.0.0-SUN-JDK-6</string>
<string>NATIVE-SRCDIST-AS-6.0.0-SUN-JDK-6</string>
+ <string>NATIVE-CORE-AS-6.0.1-SUN-JDK-6</string>
+ <string>NATIVE-BINDIST-AS-6.0.1-SUN-JDK-6</string>
+ <string>NATIVE-SRCDIST-AS-6.0.1-SUN-JDK-6</string>
</jobNames>
<name>Native Tests</name>
<description>
@@ -90,6 +96,12 @@
<string>CXF-BINDIST-AS-6.0.0-SPRING-SUN-JDK-6</string>
<string>CXF-SRCDIST-AS-6.0.0-SUN-JDK-6</string>
<string>CXF-SRCDIST-AS-6.0.0-SPRING-SUN-JDK-6</string>
+ <string>CXF-CORE-AS-6.0.1-SUN-JDK-6</string>
+ <string>CXF-CORE-AS-6.0.1-SPRING-SUN-JDK-6</string>
+ <string>CXF-BINDIST-AS-6.0.1-SUN-JDK-6</string>
+ <string>CXF-BINDIST-AS-6.0.1-SPRING-SUN-JDK-6</string>
+ <string>CXF-SRCDIST-AS-6.0.1-SUN-JDK-6</string>
+ <string>CXF-SRCDIST-AS-6.0.1-SPRING-SUN-JDK-6</string>
</jobNames>
<name>CXF Tests</name>
<description>
@@ -111,9 +123,15 @@
<string>CXF-CORE-AS-6.0.0-SPRING-SUN-JDK-6</string>
<string>CXF-BINDIST-AS-6.0.0-SUN-JDK-6</string>
<string>CXF-BINDIST-AS-6.0.0-SPRING-SUN-JDK-6</string>
+ <string>CXF-CORE-AS-6.0.1-SUN-JDK-6</string>
+ <string>CXF-CORE-AS-6.0.1-SPRING-SUN-JDK-6</string>
+ <string>CXF-BINDIST-AS-6.0.1-SUN-JDK-6</string>
+ <string>CXF-BINDIST-AS-6.0.1-SPRING-SUN-JDK-6</string>
<string>NATIVE-LIGHT</string>
<string>NATIVE-CORE-AS-6.0.0-SUN-JDK-6</string>
<string>NATIVE-BINDIST-AS-6.0.0-SUN-JDK-6</string>
+ <string>NATIVE-CORE-AS-6.0.1-SUN-JDK-6</string>
+ <string>NATIVE-BINDIST-AS-6.1.0-SUN-JDK-6</string>
</jobNames>
<name>Working Days Tests</name>
<description>
13 years, 11 months