Author: richard.opalka(a)jboss.com
Date: 2010-07-09 04:42:12 -0400 (Fri, 09 Jul 2010)
New Revision: 12611
Added:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/WebservicesDescriptorProcessorImpl.java
Removed:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
Log:
[JBWS-3086] merging CXF protype upstream
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java
(from rev 12281,
framework/branches/jms-integration/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/AbstractDefaultEndpoint.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -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;
+ }
+
+}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2010-07-09
08:10:04 UTC (rev 12610)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ArchiveDeploymentModelFactory.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -42,8 +42,22 @@
return new DefaultService();
}
+ @Deprecated
+ /**
+ * Use #newHttpEndpoint(String) instead
+ */
public Endpoint newEndpoint(String targetBean)
{
- return new DefaultEndpoint(targetBean);
+ return this.newHttpEndpoint(targetBean);
}
+
+ public Endpoint newHttpEndpoint(String targetBean)
+ {
+ return new DefaultHttpEndpoint(targetBean);
+ }
+
+ public Endpoint newJMSEndpoint(String targetBean)
+ {
+ return new DefaultJMSEndpoint(targetBean);
+ }
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2010-07-09
08:10:04 UTC (rev 12610)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultDeploymentModelFactory.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -42,8 +42,22 @@
return new DefaultService();
}
+ @Deprecated
+ /**
+ * Use #newHttpEndpoint(String) instead
+ */
public Endpoint newEndpoint(String targetBean)
{
- return new DefaultEndpoint(targetBean);
+ return this.newHttpEndpoint(targetBean);
}
+
+ public Endpoint newHttpEndpoint(String targetBean)
+ {
+ return new DefaultHttpEndpoint(targetBean);
+ }
+
+ public Endpoint newJMSEndpoint(String targetBean)
+ {
+ return new DefaultJMSEndpoint(targetBean);
+ }
}
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2010-07-09
08:10:04 UTC (rev 12610)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -1,329 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.framework.deployment;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.jboss.wsf.common.injection.InjectionException;
-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.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 JAXWS endpoint.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class DefaultEndpoint extends AbstractExtensible implements Endpoint
-{
- private Service service;
- private ObjectName name;
- private String shortName;
- private String urlPattern;
- private String targetBean;
- private Class<?> targetBeanClass;
- private EndpointState state;
- private RequestHandler requestHandler;
- private InvocationHandler invocationHandler;
- private LifecycleHandler lifecycleHandler;
- private EndpointMetrics metrics;
- private String address;
- private List<RecordProcessor> recordProcessors = new
Vector<RecordProcessor>();
-
- DefaultEndpoint(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 String getAddress()
- {
- return this.address;
- }
-
- public void setAddress(String address)
- {
- this.address = address;
- }
-
- 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 String getURLPattern()
- {
- return urlPattern;
- }
-
- public void setURLPattern(String urlPattern)
- {
- assertEndpointSetterAccess();
- this.urlPattern = urlPattern;
- }
-
- 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;
- }
-
- public EndpointMetrics getEndpointMetrics()
- {
- return metrics;
- }
-
- public void setEndpointMetrics(EndpointMetrics metrics)
- {
- assertEndpointSetterAccess();
- metrics.setEndpoint(this);
- this.metrics = metrics;
-
- }
-
- @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);
- }
-
- @Override
- public void removeProperty(String key)
- {
- assertEndpointSetterAccess();
- super.removeProperty(key);
- }
-
- @Override
- public void setProperty(String key, Object value)
- {
- assertEndpointSetterAccess();
- super.setProperty(key, value);
- }
-
- private 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);
- }
- }
- }
- }
-
- @Override
- public Context getJNDIContext()
- {
- Context retVal = null;
-
- try
- {
- retVal = this.getInvocationHandler().getJNDIContext(this);
- }
- catch (NamingException e)
- {
- final String message = "Cannot get JNDI context";
- InjectionException.rethrow(message, e);
- }
-
- return retVal;
- }
-
-}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
(from rev 12281,
framework/branches/jms-integration/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultHttpEndpoint.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -0,0 +1,85 @@
+/*
+ * 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.wsf.common.injection.InjectionException;
+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
+{
+
+ 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)
+ {
+ final String message = "Cannot get JNDI context";
+ InjectionException.rethrow(message, e);
+ }
+
+ return retVal;
+ }
+
+}
Copied:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java
(from rev 12281,
framework/branches/jms-integration/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java)
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultJMSEndpoint.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -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// TODO: moved to HttpEndpoint - explicit cast required
+ public String getURLPattern()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Deprecated// TODO: moved to HttpEndpoint - explicit cast required
+ 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)
+ {
+
+ }
+}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java 2010-07-09
08:10:04 UTC (rev 12610)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -26,6 +26,7 @@
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;
@@ -71,9 +72,9 @@
ep.setShortName(shortName);
}
- if (ep.getURLPattern() == null)
+ if (((HttpEndpoint)ep).getURLPattern() == null)
{
- ep.setURLPattern("/*");
+ ((HttpEndpoint)ep).setURLPattern("/*");
}
}
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2010-07-09
08:10:04 UTC (rev 12610)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -25,21 +25,21 @@
import java.util.Map;
import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
-import org.jboss.wsf.common.integration.WSHelper;
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;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
/**
* A deployer that assigns the endpoint address.
@@ -77,7 +77,9 @@
boolean confidential = isConfidentialTransportGuarantee(dep, ep);
int currentPort = confidential ? securePort : port;
String hostAndPort = host + (currentPort > 0 ? ":" + currentPort :
"");
- String urlPattern = ep.getURLPattern();
+
+ HttpEndpoint httpEp = (HttpEndpoint)ep;
+ String urlPattern = httpEp.getURLPattern();
if (urlPattern == null)
throw new IllegalStateException("Cannot obtain url pattern");
@@ -85,7 +87,7 @@
urlPattern = urlPattern.substring(0, urlPattern.length() - 2);
protocol = confidential ? "https://" : "http://";
- ep.setAddress(protocol + hostAndPort + contextRoot + urlPattern);
+ httpEp.setAddress(protocol + hostAndPort + contextRoot + urlPattern);
}
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2010-07-09
08:10:04 UTC (rev 12610)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -30,6 +30,7 @@
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;
@@ -48,7 +49,8 @@
{
for (Endpoint ep : dep.getService().getEndpoints())
{
- String urlPattern = ep.getURLPattern();
+ HttpEndpoint httpEp = (HttpEndpoint)ep;
+ String urlPattern = httpEp.getURLPattern();
if (urlPattern == null)
{
urlPattern = getExplicitPattern(dep, ep);
@@ -59,7 +61,7 @@
if (urlPattern.startsWith("/") == false)
urlPattern = "/" + urlPattern;
- ep.setURLPattern(urlPattern);
+ httpEp.setURLPattern(urlPattern);
}
}
}
Added:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/WebservicesDescriptorProcessorImpl.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/WebservicesDescriptorProcessorImpl.java
(rev 0)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/jms/WebservicesDescriptorProcessorImpl.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -0,0 +1,87 @@
+/*
+ * 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 java.net.URL;
+
+import org.jboss.wsf.spi.metadata.webservices.WebservicesDescriptorProcessor;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesFactory;
+import org.jboss.xb.binding.ObjectModelFactory;
+
+/**
+ * Webservices descriptor processor implementation.
+ *
+ * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
+ */
+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)
+ */
+ @Override
+ 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;
+ }
+}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java 2010-07-09
08:10:04 UTC (rev 12610)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java 2010-07-09
08:42:12 UTC (rev 12611)
@@ -184,18 +184,12 @@
private String getAddressHtmlTag(final URL requestURL, final Endpoint ep) throws
IOException
{
String address = createAddress(requestURL, ep.getAddress());
- try
+
+ if (address.startsWith("jms"))
{
- String scheme = new URI(address).getScheme();
- if (scheme.equalsIgnoreCase("jms"))
- {
- return ep.getAddress();
- }
+ return ep.getAddress();
}
- catch (Exception e)
- {
- //ignore
- }
+
StringBuilder sb = new StringBuilder("<a href='");
sb.append(address);
sb.append("?wsdl'>");