JBossWS SVN: r5904 - stack/native/trunk/src/test/resources/tools/jbws1231.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-03-10 07:41:04 -0400 (Mon, 10 Mar 2008)
New Revision: 5904
Modified:
stack/native/trunk/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml
Log:
[JBWS-2018] Fixed testcase mapping file to align with modified generator (variable mappings and multiple packages)
Modified: stack/native/trunk/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml
===================================================================
--- stack/native/trunk/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml 2008-03-10 11:39:32 UTC (rev 5903)
+++ stack/native/trunk/src/test/resources/tools/jbws1231/jaxrpc-mapping.xml 2008-03-10 11:41:04 UTC (rev 5904)
@@ -29,6 +29,10 @@
<java-type>org.jboss.test.ws.tools.jbws1231.CustomException</java-type>
<root-type-qname xmlns:typeNS='http://org.jboss.test.ws/jbws1231/type'>typeNS:CustomException</root-type-qname>
<qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>wrappedException</java-variable-name>
+ <xml-element-name>wrappedException</xml-element-name>
+ </variable-mapping>
</java-xml-type-mapping>
<java-xml-type-mapping>
<java-type>org.jboss.test.ws.tools.jbws1231.TestEndpoint_echoDataObject_ResponseStruct</java-type>
@@ -42,6 +46,9 @@
<exception-mapping>
<exception-type>org.jboss.test.ws.tools.jbws1231.CustomException</exception-type>
<wsdl-message xmlns:exMsgNS='http://org.jboss.test.ws/jbws1231'>exMsgNS:CustomException</wsdl-message>
+ <constructor-parameter-order>
+ <element-name>wrappedException</element-name>
+ </constructor-parameter-order>
</exception-mapping>
<service-interface-mapping>
<service-interface>org.jboss.test.ws.tools.jbws1231.TestService</service-interface>
16 years, 3 months
JBossWS SVN: r5903 - in stack/native/trunk/src/main/java/org/jboss/ws/tools: helpers and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-03-10 07:39:32 -0400 (Mon, 10 Mar 2008)
New Revision: 5903
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
stack/native/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
Log:
[JBWS-2018] Fixed - JavatoWSDL Package to Namespace mapping does not support multiple packages
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2008-03-10 11:29:50 UTC (rev 5902)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2008-03-10 11:39:32 UTC (rev 5903)
@@ -25,8 +25,10 @@
import java.io.StringWriter;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.xml.rpc.encoding.TypeMapping;
@@ -242,11 +244,18 @@
* think about changing just the type namespace as the types are
* generated using the typenamespace.
*
- * @param pn The Map
+ * @param map The Map
*/
- public void setPackageNamespaceMap(Map<String,String> pn)
+ public void setPackageNamespaceMap(Map<String,String> map)
{
- this.packageNamespaceMap = pn;
+ //Lets convert the namespace->package map to package->namespace map
+ Set<String> keys = map.keySet();
+ Iterator<String> iter = keys.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ String pkg = iter.next();
+ packageNamespaceMap.put(map.get(pkg), pkg);
+ }
}
public void setOperationMap(Map<String, List<OperationConfig>> operationMap)
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2008-03-10 11:29:50 UTC (rev 5902)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2008-03-10 11:39:32 UTC (rev 5903)
@@ -82,7 +82,6 @@
private JavaWsdlMapping javaWsdlMapping = new JavaWsdlMapping();
private Map<QName, JavaXmlTypeMapping> mappedTypes = new HashMap<QName, JavaXmlTypeMapping>();
private Set<String> mappedPackages = new HashSet<String>();
- private Map<String,String> packageNamespaceMap = new HashMap<String,String>();
private Set<String> mappedExceptions = new HashSet<String>();
protected void processTypes()
@@ -249,7 +248,9 @@
for(FaultMetaData fmd : operation.getFaults())
{
- JavaXmlTypeMapping typeMapping = mappedTypes.get(fmd.getXmlType());
+ String ns = getNamespace(fmd.getJavaType(), fmd.getXmlType().getNamespaceURI());
+ QName newXmlType = new QName(ns, fmd.getXmlType().getLocalPart());
+ JavaXmlTypeMapping typeMapping = mappedTypes.get(newXmlType);
if (typeMapping == null)
continue;
@@ -277,7 +278,7 @@
// Add package mapping for SEI
String name = endpoint.getServiceEndpointInterface().getPackage().getName();
- String namespace = packageNamespaceMap.get(name);
+ String namespace = getNamespace(name);
if (namespace == null)
namespace = WSDLUtils.getInstance().getTypeNamespace(name);
addPackageMapping(name, namespace);
@@ -309,7 +310,7 @@
WsdlReturnValueMapping returnMapping = new WsdlReturnValueMapping(methodMapping);
returnMapping.setMethodReturnValue(type);
returnMapping.setWsdlMessagePartName(name);
- String messageName = interfaceName + "_" + operation.getQName().getLocalPart() + "Response";;
+ String messageName = interfaceName + "_" + operation.getQName().getLocalPart() + "Response";
QName messageQName = new QName(wsdl.getTargetNamespace(), messageName, "wsdlMsgNS");
returnMapping.setWsdlMessage(messageQName);
methodMapping.setWsdlReturnValueMapping(returnMapping);
@@ -358,6 +359,7 @@
if(Holder.class.isAssignableFrom(javaType))
javaType = WSDLUtils.getInstance().getJavaTypeForHolder(javaType);
JBossXSModel xsModel = javaToXSD.generateForSingleType(xmlType, javaType, elementNames);
+ String namespace = getNamespace(javaType, xmlType.getNamespaceURI());
// Now that the schema object graph is built,
// ask JavaToXSD to provide a list of xsmodels to be plugged
// into WSDLTypes
@@ -365,22 +367,34 @@
throw new WSException("XSModel is null");
WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
- WSDLUtils.addSchemaModel(wsdlTypes, xmlType.getNamespaceURI(), xsModel);
- wsdl.registerNamespaceURI(xmlType.getNamespaceURI(), null);
+ WSDLUtils.addSchemaModel(wsdlTypes, namespace, xsModel);
+ wsdl.registerNamespaceURI(namespace, null);
//Also get any custom namespaces
SchemaCreatorIntf schemaCreator = javaToXSD.getSchemaCreator();
mergeJavaWsdlMapping(schemaCreator.getJavaWsdlMapping());
- HashMap map = schemaCreator.getCustomNamespaceMap();
- Set keys = map != null ? map.keySet() : null;
+ //Register the global config namespaces
+ /*Map<String, String> nsmap = schemaCreator.getPackageNamespaceMap();
+ Set keys = nsmap != null ? nsmap.keySet() : null;
Iterator iter = (keys != null && !keys.isEmpty()) ? keys.iterator() : null;
while (iter != null && iter.hasNext())
{
- String pref = (String)iter.next();
- String ns = (String)map.get(pref);
+ String pkg = (String)iter.next();
+ String ns = nsmap.get(pkg);
if (ns != null)
wsdl.registerNamespaceURI(ns, null);
+ }*/
+ //Register the custom generated namespaces
+ Map<String, String> nsmap = schemaCreator.getCustomNamespaceMap();
+ Set keys = nsmap != null ? nsmap.keySet() : null;
+ Iterator iter = (keys != null && !keys.isEmpty()) ? keys.iterator() : null;
+ while (iter != null && iter.hasNext())
+ {
+ String prefix = (String)iter.next();
+ String ns = nsmap.get(prefix);
+ if (ns != null)
+ wsdl.registerNamespaceURI(ns, null);
}
}
@@ -390,7 +404,7 @@
for (PackageMapping packageMapping : source.getPackageMappings())
{
String name = packageMapping.getPackageType();
- String namespaceURI = packageMapping.getNamespaceURI();
+ String namespaceURI = getNamespace(name, packageMapping.getNamespaceURI());
addPackageMapping(name, namespaceURI);
}
@@ -401,17 +415,22 @@
if (name == null)
name = type.getAnonymousTypeQName();
+ //override namespace from globalconfig
+ String pkgName = getJustPackageName(type.getJavaType());
+ String ns = getNamespace(pkgName, name.getNamespaceURI());
+ name = new QName(ns, name.getLocalPart(), name.getPrefix());
+
if (mappedTypes.containsKey(name))
continue;
+ addPackageMapping(pkgName, ns);
mappedTypes.put(name, type);
JavaXmlTypeMapping typeCopy = new JavaXmlTypeMapping(javaWsdlMapping);
typeCopy.setQNameScope(type.getQnameScope());
typeCopy.setAnonymousTypeQName(type.getAnonymousTypeQName());
typeCopy.setJavaType(type.getJavaType());
- typeCopy.setRootTypeQName(type.getRootTypeQName());
-
+ typeCopy.setRootTypeQName(name);
for (VariableMapping variable : type.getVariableMappings())
{
VariableMapping variableCopy = new VariableMapping(typeCopy);
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2008-03-10 11:29:50 UTC (rev 5902)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2008-03-10 11:39:32 UTC (rev 5903)
@@ -304,12 +304,12 @@
if (xmlType != null)
{
name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
+ namespace = getNamespace(javaType, xmlType.getNamespaceURI());
}
else
{
name = WSDLUtils.getJustClassName(javaType);
- namespace = getNamespace(javaType);
+ namespace = getNamespace(javaType, null);
}
// Check if it is a JAX-RPC enumeration
@@ -574,12 +574,12 @@
if (isComponentArray == false)
{
name = utils.getJustClassName(componentType.getName()) + ".Array";
- namespace = getNamespace(componentType);
+ namespace = getNamespace(componentType, null);
}
else
{
name = xst.getName() + ".Array";
- namespace = xst.getNamespace();
+ namespace = getNamespace(componentType, xst.getNamespace());
}
}
@@ -701,19 +701,34 @@
}
}
- private String getNamespace(Class javaType)
+ private String getNamespace(Class javaType, String defaultNS)
{
if (javaType.isPrimitive())
return Constants.NS_JBOSSWS_URI + "/primitives";
Package javaPackage = javaType.getPackage();
if (javaPackage == null)
- throw new WSException("Cannot determine namespace, Class had no package");
+ {
+ if (defaultNS != null)
+ {
+ return defaultNS;
+ }
+ else
+ {
+ throw new WSException("Cannot determine namespace, Class had no package");
+ }
+ }
String packageName = javaPackage.getName();
String ns = packageNamespaceMap.get(packageName);
- if (ns == null)
+ if (ns == null && defaultNS == null)
+ {
ns = utils.getTypeNamespace(packageName);
+ }
+ else if (ns == null)
+ {
+ ns = defaultNS;
+ }
allocatePrefix(ns);
@@ -731,12 +746,12 @@
String namespace;
if (xmlType != null)
{
- namespace = xmlType.getNamespaceURI();
+ namespace = getNamespace(javaType, xmlType.getNamespaceURI());
name = xmlType.getLocalPart();
}
else
{
- namespace = getNamespace(javaType);
+ namespace = getNamespace(javaType, null);
name = WSDLUtils.getJustClassName(javaType);
}
@@ -749,6 +764,8 @@
xsModel.addXSComplexTypeDefinition(complexType);
xsModel.addXSElementDeclaration(sutils.createGlobalXSElementDeclaration(name, complexType, namespace));
typeMapping.register(javaType, new QName(namespace, name), null, null);
+ generateExceptionParticles(namespace, javaType, types, particles);
+
registerJavaTypeMapping(new QName(namespace, name), javaType, "complexType", particles, null);
Class superClass = javaType.getSuperclass();
@@ -758,7 +775,6 @@
complexType.setBaseType(baseType);
}
- generateExceptionParticles(namespace, javaType, types, particles);
boolean found = hasConstructor(javaType, types);
boolean noarg = found && types.size() == 0;
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2008-03-10 11:29:50 UTC (rev 5902)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2008-03-10 11:39:32 UTC (rev 5903)
@@ -292,8 +292,7 @@
if (writtenFaultMessages.contains(exceptionName))
continue;
- WSDLInterfaceFault interfaceFault = operation.getWsdlInterface().getFault(fault.getRef());
- QName xmlName = interfaceFault.getElement();
+ QName xmlName = fault.getRef();
buffer.append("<message name='" + exceptionName + "' >");
String prefix = wsdl.getPrefix(xmlName.getNamespaceURI());
@@ -456,8 +455,7 @@
for (WSDLInterfaceOperationOutfault fault : operation.getOutfaults())
{
QName element = fault.getRef();
- String faultPrefix = wsdl.getPrefix(element.getNamespaceURI());
- buffer.append("<fault message='" + faultPrefix + ":" + element.getLocalPart());
+ buffer.append("<fault message='" + prefix + ":" + element.getLocalPart());
buffer.append("' name='" + element.getLocalPart() + "'/>");
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2008-03-10 11:29:50 UTC (rev 5902)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2008-03-10 11:39:32 UTC (rev 5903)
@@ -23,7 +23,10 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.util.HashMap;
import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
@@ -82,6 +85,8 @@
protected abstract void processTypes();
+ protected Map<String,String> packageNamespaceMap = new HashMap<String,String>();
+
protected void processEndpoint(WSDLService service, EndpointMetaData endpoint)
{
WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(service, endpoint.getPortName());
@@ -238,7 +243,9 @@
wsdlInterface.addFault(interfaceFault);
WSDLInterfaceOperationOutfault outfault = new WSDLInterfaceOperationOutfault(interfaceOperation);
- outfault.setRef(faultName);
+ String ns = getNamespace(fault.getJavaType(), operation.getQName().getNamespaceURI());
+ QName outFaultName = new QName(ns, fault.getXmlName().getLocalPart());
+ outfault.setRef(outFaultName);
interfaceOperation.addOutfault(outfault);
WSDLBindingFault bindingFault = new WSDLBindingFault(wsdlBinding);
@@ -399,7 +406,11 @@
}
else
{
- WSDLRPCPart part = new WSDLRPCPart(returnParameter.getPartName(), returnParameter.getXmlType());
+ QName xmlType = returnParameter.getXmlType();
+ String ns = getNamespace(returnParameter.getJavaType(), xmlType.getNamespaceURI());
+ QName newXmlType = new QName(ns, xmlType.getLocalPart());
+ WSDLRPCPart part = new WSDLRPCPart(partName, newXmlType);
+
output.addChildPart(part);
}
addSignatureItem(interfaceOperation, returnParameter, true);
@@ -422,7 +433,11 @@
}
else
{
- WSDLRPCPart part = new WSDLRPCPart(param.getPartName(), param.getXmlType());
+ QName xmlType = param.getXmlType();
+
+ String ns = getNamespace(param.getJavaType(), xmlType.getNamespaceURI());
+ QName newXmlType = new QName(ns, xmlType.getLocalPart());
+ WSDLRPCPart part = new WSDLRPCPart(param.getPartName(), newXmlType);
if (param.getMode() != ParameterMode.OUT)
input.addChildPart(part);
if (twoWay && param.getMode() != ParameterMode.IN)
@@ -472,6 +487,18 @@
wsdl.registerNamespaceURI(ns, "tns");
wsdl.registerNamespaceURI(Constants.NS_SCHEMA_XSD, "xsd");
+ // Register global namespaces
+ if (packageNamespaceMap != null)
+ {
+ Set<String> keys = packageNamespaceMap.keySet();
+ Iterator<String> iter = keys.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ String pkg = iter.next();
+ wsdl.registerNamespaceURI(packageNamespaceMap.get(pkg), null);
+ }
+ }
+
String soapURI = null;
String soapPrefix = null;
for (EndpointMetaData ep : service.getEndpoints())
@@ -497,4 +524,44 @@
return wsdl;
}
+
+ protected String getNamespace(String packageName, String defaultNS)
+ {
+ String retNS = defaultNS;
+ //Get it from global config if it is overriden
+ if (packageNamespaceMap != null)
+ {
+ String ns = packageNamespaceMap.get(packageName);
+ if (ns != null)
+ {
+ retNS = ns;
+ }
+ }
+ return retNS;
+ }
+
+ protected String getNamespace(String packageName)
+ {
+ return getNamespace(packageName, wsdl.getTargetNamespace());
+ }
+
+ protected String getNamespace(Class type, String defaultNS)
+ {
+ Package pkg = type.getPackage();
+ String pkgName = null;
+ if (pkg != null)
+ {
+ pkgName = pkg.getName();
+ }
+ return getNamespace(pkgName, defaultNS);
+ }
+
+ protected String getJustPackageName(String classname)
+ {
+ int index = classname.lastIndexOf(".");
+ if (index < 0)
+ index = classname.length();
+ else index = index;
+ return classname.substring(0,index);
+ }
}
16 years, 3 months
JBossWS SVN: r5902 - in stack/native/trunk/src/test/resources/tools: jbws1441 and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-03-10 07:29:50 -0400 (Mon, 10 Mar 2008)
New Revision: 5902
Modified:
stack/native/trunk/src/test/resources/tools/jbws1217/jaxrpc-mapping.xml
stack/native/trunk/src/test/resources/tools/jbws1441/jaxrpc-mapping.xml
stack/native/trunk/src/test/resources/tools/jbws1881/doclit/jaxrpc-mapping.xml
Log:
[JBWS-1217] Fixed testcase mapping files to align with modified generator (base types)
Modified: stack/native/trunk/src/test/resources/tools/jbws1217/jaxrpc-mapping.xml
===================================================================
--- stack/native/trunk/src/test/resources/tools/jbws1217/jaxrpc-mapping.xml 2008-03-10 11:26:49 UTC (rev 5901)
+++ stack/native/trunk/src/test/resources/tools/jbws1217/jaxrpc-mapping.xml 2008-03-10 11:29:50 UTC (rev 5902)
@@ -1,13 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
<package-mapping>
- <package-type>com.other.exception</package-type>
- <namespaceURI>http://other.com</namespaceURI>
+ <package-type>com.other.base</package-type>
+ <namespaceURI>http://other.com.base</namespaceURI>
</package-mapping>
<package-mapping>
<package-type>org.jboss.test.ws.jbws1217</package-type>
<namespaceURI>http://org.jboss.test.ws/jbws1217</namespaceURI>
</package-mapping>
+ <package-mapping>
+ <package-type>com.other.exception</package-type>
+ <namespaceURI>http://other.com</namespaceURI>
+ </package-mapping>
<java-xml-type-mapping>
+ <java-type>com.other.base.BaseException</java-type>
+ <root-type-qname xmlns:typeNS='http://other.com.base'>typeNS:BaseException</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
<java-type>com.other.exception.TestException</java-type>
<root-type-qname xmlns:typeNS='http://other.com'>typeNS:TestException</root-type-qname>
<qname-scope>complexType</qname-scope>
Modified: stack/native/trunk/src/test/resources/tools/jbws1441/jaxrpc-mapping.xml
===================================================================
--- stack/native/trunk/src/test/resources/tools/jbws1441/jaxrpc-mapping.xml 2008-03-10 11:26:49 UTC (rev 5901)
+++ stack/native/trunk/src/test/resources/tools/jbws1441/jaxrpc-mapping.xml 2008-03-10 11:29:50 UTC (rev 5902)
@@ -8,6 +8,11 @@
<package-type>org.jboss.test.ws.jbws1441</package-type>
<namespaceURI>http://test.jboss.org/ws/jbws1441/types</namespaceURI>
</package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1441.AbstractType</java-type>
+ <root-type-qname xmlns:typeNS="http://test.jboss.org/ws/jbws1441/types">typeNS:AbstractType</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ </java-xml-type-mapping>
<java-xml-type-mapping>
<java-type>org.jboss.test.ws.jbws1441.TelephoneNumber</java-type>
<root-type-qname xmlns:typeNS="http://test.jboss.org/ws/jbws1441/types">typeNS:TelephoneNumber</root-type-qname>
Modified: stack/native/trunk/src/test/resources/tools/jbws1881/doclit/jaxrpc-mapping.xml
===================================================================
--- stack/native/trunk/src/test/resources/tools/jbws1881/doclit/jaxrpc-mapping.xml 2008-03-10 11:26:49 UTC (rev 5901)
+++ stack/native/trunk/src/test/resources/tools/jbws1881/doclit/jaxrpc-mapping.xml 2008-03-10 11:29:50 UTC (rev 5902)
@@ -8,6 +8,15 @@
<namespaceURI>http://test.jboss.org/ws/jbws1881</namespaceURI>
</package-mapping>
<java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1881.Base</java-type>
+ <root-type-qname xmlns:typeNS='http://test.jboss.org/ws/jbws1881/types'>typeNS:base</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>id</java-variable-name>
+ <xml-element-name>id</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
<java-type>org.jboss.test.ws.jbws1881.Person</java-type>
<root-type-qname xmlns:typeNS='http://test.jboss.org/ws/jbws1881/types'>typeNS:Person</root-type-qname>
<qname-scope>complexType</qname-scope>
16 years, 3 months
JBossWS SVN: r5901 - in stack/native/trunk/src/main/java/org/jboss/ws/tools: mapping and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-03-10 07:26:49 -0400 (Mon, 10 Mar 2008)
New Revision: 5901
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
stack/native/trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
Log:
[JBWS-1217] Fixed generator to generate base types too in the mapping file
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2008-03-10 10:38:31 UTC (rev 5900)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2008-03-10 11:26:49 UTC (rev 5901)
@@ -23,6 +23,7 @@
import java.beans.Introspector;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -99,7 +100,7 @@
private String typeNamespace;
private String serviceName = null;
private String packageName = null;
- private Map<String, String> namespacePackageMap = null;
+ private Map<String, String> namespacePackageMap = new HashMap<String,String>();
private Set<String> registeredTypes = new HashSet<String>();
private Set<String> registeredExceptions = new HashSet<String>();
@@ -479,6 +480,7 @@
WsdlReturnValueMapping wrvm = new WsdlReturnValueMapping(semm);
wrvm.setMethodReturnValue(getJavaTypeAsString(xmlName, xmlType, nameSpace, false, true));
QName messageName = WSDLUtils.getWsdl11Output(wiop).getMessageName();
+
wrvm.setWsdlMessage(new QName(messageName.getNamespaceURI(), messageName.getLocalPart(), WSToolsConstants.WSTOOLS_CONSTANT_MAPPING_WSDL_MESSAGE_NS));
wrvm.setWsdlMessagePartName(partName);
semm.setWsdlReturnValueMapping(wrvm);
@@ -711,9 +713,17 @@
if (xt instanceof XSComplexTypeDefinition)
{
-
XSModelGroup xm = null;
XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xt;
+ XSTypeDefinition baseType = xc.getBaseType();
+ short der = xc.getDerivationMethod();
+
+ if ((baseType != null) && !utils.isBaseTypeIgnorable(baseType, xc))
+ {
+ addJavaXMLTypeMap(baseType, baseType.getName(), "", "", jwm, skipWrapperArray); //Recurse for base types
+ }
+
+ // handleContentTypeElementsWithDerivationNone
if (xc.getContentType() != XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
{
XSParticle xp = xc.getParticle();
@@ -797,12 +807,15 @@
{
XSTerm xsterm = ((XSParticle)xo.item(i)).getTerm();
if (xsterm instanceof XSModelGroup)
+ {
addVariableMappingMap((XSModelGroup)xsterm, jxtm, javaType);
+ }
else if (xsterm instanceof XSElementDeclaration)
{
XSElementDeclaration xe = (XSElementDeclaration)xsterm;
VariableMapping vm = new VariableMapping(jxtm);
String name = xe.getName();
+
// JBWS-1170 Convert characters which are illegal in Java identifiers
vm.setJavaVariableName(ToolsUtils.convertInvalidCharacters(Introspector.decapitalize(name)));
vm.setXmlElementName(name);
Modified: stack/native/trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2008-03-10 10:38:31 UTC (rev 5900)
+++ stack/native/trunk/src/main/java/org/jboss/ws/tools/mapping/MappingFileGenerator.java 2008-03-10 11:26:49 UTC (rev 5901)
@@ -24,8 +24,11 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.xml.rpc.encoding.TypeMapping;
@@ -72,7 +75,7 @@
/**
* Package Names to override
*/
- protected Map<String, String> namespacePackageMap;
+ protected Map<String, String> namespacePackageMap = new HashMap<String,String>();
/**
* Service Name
@@ -205,6 +208,20 @@
jwm.addPackageMapping(helper.constructPackageMapping(jwm, getPackageName(typeNamespace), typeNamespace));
jwm.addPackageMapping(helper.constructPackageMapping(jwm, getPackageName(targetNS), targetNS));
+ if (namespacePackageMap != null)
+ {
+ Set<String> keys = namespacePackageMap.keySet();
+ Iterator<String> iter = keys.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ String ns = iter.next();
+ if (jwm.getPackageNameForNamespaceURI(ns) == null)
+ {
+ jwm.addPackageMapping(helper.constructPackageMapping(jwm, namespacePackageMap.get(ns), ns));
+ }
+ }
+ }
+
return jwm;
}
16 years, 3 months
JBossWS SVN: r5900 - in stack/native/trunk/src: main/java/org/jboss/ws/extensions/security/jaxrpc and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-03-10 06:38:31 -0400 (Mon, 10 Mar 2008)
New Revision: 5900
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityAPI.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
Log:
[JBWS-2022] Provide interface for WSSecurityDispatcher
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityAPI.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityAPI.java 2008-03-08 19:50:10 UTC (rev 5899)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityAPI.java 2008-03-10 10:38:31 UTC (rev 5900)
@@ -29,6 +29,12 @@
import org.jboss.ws.metadata.wsse.Config;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+/**
+ * WS-Security functionalities interface
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 06-Mar-2008
+ */
public interface WSSecurityAPI
{
/**
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2008-03-08 19:50:10 UTC (rev 5899)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2008-03-10 10:38:31 UTC (rev 5900)
@@ -27,18 +27,12 @@
import java.util.List;
import javax.xml.namespace.QName;
-import javax.xml.rpc.Stub;
-import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.BindingProvider;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAPFaultException;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.extensions.security.exception.InvalidSecurityHeaderException;
import org.jboss.ws.extensions.security.exception.WSSecurityException;
import org.jboss.ws.metadata.wsse.Config;
@@ -86,23 +80,6 @@
return new CommonSOAPFaultException(e.getFaultCode(), e.getFaultString());
}
- public static void handleInbound(CommonMessageContext ctx) throws SOAPException, SOAPFaultException
- {
- WSSecurityConfiguration configuration = getSecurityConfig(ctx);
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
-
- new WSSecurityDispatcher().decodeMessage(configuration, soapMessage, new MessageContextConfigSelector(ctx)); //TODO!!!
- }
-
- private static WSSecurityConfiguration getSecurityConfig(CommonMessageContext ctx)
- {
- WSSecurityConfiguration config = ctx.getEndpointMetaData().getServiceMetaData().getSecurityConfiguration();
- if (config == null)
- throw new WSException("Cannot obtain security configuration from message context");
-
- return config;
- }
-
private static List<OperationDescription<RequireOperation>> buildRequireOperations(Config operationConfig)
{
if (operationConfig == null)
@@ -134,25 +111,8 @@
return operations;
}
- public static void handleOutbound(CommonMessageContext ctx) throws SOAPException, SOAPFaultException
+ private static Config getActualConfig(WSSecurityConfiguration configuration, Config operationConfig)
{
- WSSecurityConfiguration configuration = getSecurityConfig(ctx);
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
-
- String user = (String)ctx.get(Stub.USERNAME_PROPERTY);
- String pass = (String)ctx.get(Stub.PASSWORD_PROPERTY);
-
- if (user == null && pass == null)
- {
- user = (String)ctx.get(BindingProvider.USERNAME_PROPERTY);
- pass = (String)ctx.get(BindingProvider.PASSWORD_PROPERTY);
- }
-
- new WSSecurityDispatcher().encodeMessage(configuration, soapMessage, new MessageContextConfigSelector(ctx), user, pass); //TODO!!
- }
-
- private static Config getConfig(WSSecurityConfiguration configuration, Config operationConfig)
- {
//null operationConfig means default behavior
return operationConfig != null ? operationConfig : configuration.getDefaultConfig();
}
@@ -164,7 +124,7 @@
public void decodeMessage(WSSecurityConfiguration configuration, SOAPMessage message, Config operationConfig) throws SOAPException
{
- Config config = getConfig(configuration, operationConfig);
+ Config config = getActualConfig(configuration, operationConfig);
SOAPHeader soapHeader = message.getSOAPHeader();
QName secQName = new QName(Constants.WSSE_NS, "Security");
Element secHeaderElement = (soapHeader != null) ? Util.findElement(soapHeader, secQName) : null;
@@ -212,7 +172,7 @@
public void encodeMessage(WSSecurityConfiguration configuration, SOAPMessage message, Config operationConfig, String user, String password) throws SOAPException
{
- Config config = getConfig(configuration, operationConfig);
+ Config config = getActualConfig(configuration, operationConfig);
log.debug("WS-Security config: " + config);
// Nothing to process
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2008-03-08 19:50:10 UTC (rev 5899)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/jaxrpc/WSSecurityHandler.java 2008-03-10 10:38:31 UTC (rev 5900)
@@ -26,6 +26,7 @@
import java.io.IOException;
import javax.xml.namespace.QName;
+import javax.xml.rpc.Stub;
import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.soap.SOAPException;
@@ -33,7 +34,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.MessageContextConfigSelector;
import org.jboss.ws.extensions.security.WSSecurityDispatcher;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
@@ -61,9 +64,13 @@
{
try
{
- if (getSecurityConfiguration(msgContext) != null)
+ WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
+ if (configuration != null)
{
- WSSecurityDispatcher.handleInbound((CommonMessageContext)msgContext);
+ CommonMessageContext ctx = (CommonMessageContext)msgContext;
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
+
+ new WSSecurityDispatcher().decodeMessage(configuration, soapMessage, new MessageContextConfigSelector(ctx));
}
}
catch (SOAPException ex)
@@ -78,9 +85,15 @@
{
try
{
- if (getSecurityConfiguration(msgContext) != null)
+ WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
+ if (configuration != null)
{
- WSSecurityDispatcher.handleOutbound((CommonMessageContext)msgContext);
+ CommonMessageContext ctx = (CommonMessageContext)msgContext;
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
+
+ String user = (String)ctx.get(Stub.USERNAME_PROPERTY);
+ String pass = (String)ctx.get(Stub.PASSWORD_PROPERTY);
+ new WSSecurityDispatcher().encodeMessage(configuration, soapMessage, new MessageContextConfigSelector(ctx), user, pass);
}
}
catch (SOAPException ex)
Modified: stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java 2008-03-08 19:50:10 UTC (rev 5899)
+++ stack/native/trunk/src/main/java/org/jboss/ws/extensions/security/jaxws/WSSecurityHandler.java 2008-03-10 10:38:31 UTC (rev 5900)
@@ -30,13 +30,16 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.handler.MessageContext;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.MessageContextConfigSelector;
import org.jboss.ws.extensions.security.WSSecurityDispatcher;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
@@ -73,9 +76,13 @@
{
try
{
- if (getSecurityConfiguration(msgContext) != null)
+ WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
+ if (configuration != null)
{
- WSSecurityDispatcher.handleInbound((CommonMessageContext)msgContext);
+ CommonMessageContext ctx = (CommonMessageContext)msgContext;
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
+
+ new WSSecurityDispatcher().decodeMessage(configuration, soapMessage, new MessageContextConfigSelector(ctx));
}
}
catch (SOAPException ex)
@@ -90,9 +97,15 @@
{
try
{
- if (getSecurityConfiguration(msgContext) != null)
+ WSSecurityConfiguration configuration = getSecurityConfiguration(msgContext);
+ if (configuration != null)
{
- WSSecurityDispatcher.handleOutbound((CommonMessageContext)msgContext);
+ CommonMessageContext ctx = (CommonMessageContext)msgContext;
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getSOAPMessage();
+
+ String user = (String)ctx.get(BindingProvider.USERNAME_PROPERTY);
+ String pass = (String)ctx.get(BindingProvider.PASSWORD_PROPERTY);
+ new WSSecurityDispatcher().encodeMessage(configuration, soapMessage, new MessageContextConfigSelector(ctx), user, pass);
}
}
catch (SOAPException ex)
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2008-03-08 19:50:10 UTC (rev 5899)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/wsse/RoundTripTestCase.java 2008-03-10 10:38:31 UTC (rev 5900)
@@ -23,6 +23,7 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.StringReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -47,9 +48,13 @@
import org.jboss.ws.extensions.security.Target;
import org.jboss.ws.extensions.security.TimestampOperation;
import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.extensions.security.WSSecurityAPI;
+import org.jboss.ws.extensions.security.WSSecurityDispatcher;
import org.jboss.ws.extensions.security.WsuIdTarget;
+import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
+import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.common.DOMWriter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -71,7 +76,6 @@
+ "</env:Envelope>";
ByteArrayInputStream inputStream = new ByteArrayInputStream(envStr.getBytes());
-
MessageFactory factory = new MessageFactoryImpl();
SOAPMessage soapMsg = factory.createMessage(null, inputStream);
SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();
@@ -103,8 +107,52 @@
assertEquals(inputString, DOMWriter.printNode(doc, true));
}
+
+ public void testRoundTripUsingAPI() throws Exception
+ {
+ String envStr = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
+ + " <env:Header>"
+ + " <tns:someHeader xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'"
+ + " tns:test='hi' xmlns:tns='http://org.jboss.ws/2004'>some header value</tns:someHeader>"
+ + " </env:Header> "
+ + " <env:Body wsu:Id='element-9-1205139829909-17908832' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>"
+ + " <tns:echoString2 xmlns:env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:tns='http://org.jboss.ws/2004' "
+ + " xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>"
+ + " <string>Hello World!</string>"
+ + " </tns:echoString2>"
+ + " <tns:echoString xmlns:tns='http://org.jboss.ws/2004'>"
+ + " <string>Hello World!</string>"
+ + " </tns:echoString>"
+ + " </env:Body>"
+ + "</env:Envelope>";
- // WS-Security leaves wsu:id attributes arround on elements which are not cleaned
+ String conf = "<jboss-ws-security xmlns='http://www.jboss.com/ws-security/config' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"
+ + " xsi:schemaLocation='http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd'>"
+ + " <config>"
+ + " <encrypt type='x509v3' alias='wsse'/>"
+ + " <sign alias='wsse'/>"
+ + " <username/>"
+ + " <requires>"
+ + " <encryption/>"
+ + " <signature/>"
+ + " </requires>"
+ + " </config>"
+ + "</jboss-ws-security>";
+ WSSecurityConfiguration configuration = WSSecurityOMFactory.newInstance().parse(new StringReader(conf));
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(envStr.getBytes());
+ MessageFactory factory = new MessageFactoryImpl();
+ SOAPMessage soapMsg = factory.createMessage(null, inputStream);
+ String expected = DOMWriter.printNode(soapMsg.getSOAPPart().getEnvelope(), true);
+
+ WSSecurityAPI sec = new WSSecurityDispatcher();
+ sec.encodeMessage(configuration, soapMsg, null, "kermit", "thefrog");
+ sec.decodeMessage(configuration, soapMsg, null);
+
+ String actual = DOMWriter.printNode(soapMsg.getSOAPPart().getEnvelope(), true);
+ assertEquals(expected, actual);
+ }
+
+ // WS-Security leaves wsu:id attributes around on elements which are not cleaned
// up due to performance reasons. This, however, breaks comparisons, so we manually
// fix this for tests.
private void cleanupWsuIds(Element element)
16 years, 3 months
JBossWS SVN: r5899 - in spi/branches/hbraun: src/main/java/org/jboss/wsf/spi and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-03-08 14:50:10 -0500 (Sat, 08 Mar 2008)
New Revision: 5899
Added:
spi/branches/hbraun/spi-3.0.iml
spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/Container.java
spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/transport/HttpSpec.java
Modified:
spi/branches/hbraun/version.properties
Log:
HttpSpec moved to SPI
Added: spi/branches/hbraun/spi-3.0.iml
===================================================================
--- spi/branches/hbraun/spi-3.0.iml (rev 0)
+++ spi/branches/hbraun/spi-3.0.iml 2008-03-08 19:50:10 UTC (rev 5899)
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/output/classes" />
+ <exclude-output />
+ <output-test url="file://$MODULE_DIR$/output/test/classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxws-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-dependency-src.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-xml-binding-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-microcontainer-src.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-dependency.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/dom4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-logging-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-javaee.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/activation.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-xml-binding.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-common-core.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/getopt.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/ant-launcher.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-logging-log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxrpc-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/servlet-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/ant.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-microcontainer.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-common-core-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxb-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/junit.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/Container.java
===================================================================
--- spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/Container.java (rev 0)
+++ spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/Container.java 2008-03-08 19:50:10 UTC (rev 5899)
@@ -0,0 +1,33 @@
+/*
+ * 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.spi;
+
+import org.jboss.wsf.spi.deployment.Deployment;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public interface Container
+{
+ void publish(Deployment endpoint);
+ void remove(Deployment endpoint);
+}
Property changes on: spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/Container.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/transport/HttpSpec.java
===================================================================
--- spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/transport/HttpSpec.java (rev 0)
+++ spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/transport/HttpSpec.java 2008-03-08 19:50:10 UTC (rev 5899)
@@ -0,0 +1,55 @@
+/*
+ * 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.spi.transport;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class HttpSpec implements TransportSpec
+{
+ private String webContext;
+ private String urlPattern;
+
+ public HttpSpec(String webContext, String urlPattern)
+ {
+ if(!webContext.startsWith("/"))
+ throw new IllegalArgumentException("webContext needs to start with '/'");
+
+ this.webContext = webContext;
+ this.urlPattern = urlPattern;
+ }
+
+ public Protocol getProtocol()
+ {
+ return Protocol.HTTP;
+ }
+
+ public String getWebContext()
+ {
+ return webContext;
+ }
+
+ public String getUrlPattern()
+ {
+ return urlPattern;
+ }
+}
Property changes on: spi/branches/hbraun/src/main/java/org/jboss/wsf/spi/transport/HttpSpec.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: spi/branches/hbraun/version.properties
===================================================================
--- spi/branches/hbraun/version.properties 2008-03-08 19:49:51 UTC (rev 5898)
+++ spi/branches/hbraun/version.properties 2008-03-08 19:50:10 UTC (rev 5899)
@@ -5,8 +5,8 @@
specification.vendor=JBoss (http://www.jboss.org)
specification.version=jbossws-2.0
-version.id=1.1.0.DEV
-repository.id=1.1.0.DEV
+version.id=3.0.0.DEV
+repository.id=snapshot
implementation.title=JBoss Web Services - SPI
implementation.url=http://www.jboss.org/products/jbossws
16 years, 3 months
JBossWS SVN: r5898 - in framework/branches/hbraun: src/main/java/org/jboss/wsf/framework and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-03-08 14:49:51 -0500 (Sat, 08 Mar 2008)
New Revision: 5898
Removed:
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpSpec.java
Modified:
framework/branches/hbraun/framework-3.0.iml
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpDeamon.java
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpListenerRef.java
framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpTransportManager.java
framework/branches/hbraun/version.properties
Log:
HttpSpec moved to SPI
Modified: framework/branches/hbraun/framework-3.0.iml
===================================================================
--- framework/branches/hbraun/framework-3.0.iml 2008-03-08 19:49:28 UTC (rev 5897)
+++ framework/branches/hbraun/framework-3.0.iml 2008-03-08 19:49:51 UTC (rev 5898)
@@ -183,15 +183,6 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/thirdparty/saaj-api.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java
===================================================================
--- framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2008-03-08 19:49:28 UTC (rev 5897)
+++ framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/DefaultSPIProvider.java 2008-03-08 19:49:51 UTC (rev 5898)
@@ -29,6 +29,7 @@
import org.jboss.wsf.framework.http.DefaultHttpServerFactory;
import org.jboss.wsf.framework.invocation.DefaultResourceInjectorFactory;
import org.jboss.wsf.framework.management.DefaultEndpointMetricsFactory;
+import org.jboss.wsf.framework.management.ServerConfigFactoryImpl;
import org.jboss.wsf.framework.serviceref.DefaultServiceRefHandlerFactory;
import org.jboss.wsf.framework.serviceref.DefaultServiceRefMetaDataParserFactory;
import org.jboss.wsf.framework.transport.DefaultTransportManagerFactory;
@@ -113,6 +114,10 @@
{
returnType = (T)loadService(spiType, DefaultTransportManagerFactory.class.getName());
}
+ else if (ServerConfigFactory.class.equals(spiType))
+ {
+ returnType = (T)loadService(spiType, ServerConfigFactoryImpl.class.getName());
+ }
// SPI provided by either container or stack integration
@@ -132,10 +137,7 @@
{
returnType = (T)loadService(spiType, null);
}
- else if (ServerConfigFactory.class.equals(spiType))
- {
- returnType = (T)loadService(spiType, null);
- }
+
else if (ServiceRefBinderFactory.class.equals(spiType))
{
returnType = (T)loadService(spiType, null);
Modified: framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
===================================================================
--- framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2008-03-08 19:49:28 UTC (rev 5897)
+++ framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2008-03-08 19:49:51 UTC (rev 5898)
@@ -137,10 +137,11 @@
// build implicit name
try
{
- String domain = "org.jboss.ws";
- String nameAtt = getShortName()!=null ? getShortName() : targetBean;
-
- name = new ObjectName(domain, "name", nameAtt);
+ name = new ObjectName(
+ Endpoint.SEPID_DOMAIN,
+ Endpoint.SEPID_PROPERTY_ENDPOINT, targetBean
+ );
+
} catch (MalformedObjectNameException e)
{
//
Modified: framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpDeamon.java
===================================================================
--- framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpDeamon.java 2008-03-08 19:49:28 UTC (rev 5897)
+++ framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpDeamon.java 2008-03-08 19:49:51 UTC (rev 5898)
@@ -23,6 +23,7 @@
import org.jboss.logging.Logger;
import org.mortbay.jetty.Server;
+import org.mortbay.jetty.Handler;
import org.mortbay.jetty.handler.ContextHandlerCollection;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
@@ -114,6 +115,11 @@
}
}
+ public void removeServletContext(String contextPath, String urlPattern)
+ {
+ LOG.warn("Cannot remove context: " + contextPath + "/" + urlPattern + "(Not implemented)");
+ }
+
public static HttpDeamon getInstance(int port)
{
CLASS_LOCK.lock();
Modified: framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpListenerRef.java
===================================================================
--- framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpListenerRef.java 2008-03-08 19:49:28 UTC (rev 5897)
+++ framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpListenerRef.java 2008-03-08 19:49:51 UTC (rev 5898)
@@ -32,11 +32,16 @@
public class HttpListenerRef implements ListenerRef
{
private String webContext;
+ private String urlPattern;
private URI address;
- public HttpListenerRef(String webContext, URI address)
+ public HttpListenerRef(String webContext, String urlPattern, URI address)
{
+ if(!webContext.startsWith("/") || !urlPattern.startsWith("/"))
+ throw new IllegalArgumentException("Both webContext and urlPattern need to start with '/'");
+
this.webContext = webContext;
+ this.urlPattern = urlPattern;
this.address = address;
}
@@ -52,6 +57,6 @@
public String getUUID()
{
- return this.webContext;
+ return this.webContext+this.urlPattern;
}
}
Deleted: framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpSpec.java
===================================================================
--- framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpSpec.java 2008-03-08 19:49:28 UTC (rev 5897)
+++ framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpSpec.java 2008-03-08 19:49:51 UTC (rev 5898)
@@ -1,59 +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.transport;
-
-import org.jboss.wsf.spi.transport.TransportSpec;
-import org.jboss.wsf.spi.transport.Protocol;
-
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class HttpSpec implements TransportSpec
-{
- private String webContext;
- private String urlPattern;
-
- public HttpSpec(String webContext, String urlPattern)
- {
- if(!webContext.startsWith("/"))
- throw new IllegalArgumentException("webContext needs to start with '/'");
-
- this.webContext = webContext;
- this.urlPattern = urlPattern;
- }
-
- public Protocol getProtocol()
- {
- return Protocol.HTTP;
- }
-
- public String getWebContext()
- {
- return webContext;
- }
-
- public String getUrlPattern()
- {
- return urlPattern;
- }
-}
Modified: framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpTransportManager.java
===================================================================
--- framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpTransportManager.java 2008-03-08 19:49:28 UTC (rev 5897)
+++ framework/branches/hbraun/src/main/java/org/jboss/wsf/framework/transport/HttpTransportManager.java 2008-03-08 19:49:51 UTC (rev 5898)
@@ -21,12 +21,21 @@
*/
package org.jboss.wsf.framework.transport;
+import org.jboss.logging.Logger;
+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.invocation.EndpointAssociation;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.spi.transport.ListenerRef;
import org.jboss.wsf.spi.transport.TransportManager;
+import org.jboss.wsf.spi.transport.HttpSpec;
-import javax.management.ObjectName;
import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -42,8 +51,8 @@
{
private HttpDeamon httpDeamon;
- private static final int DEFAULT_PORT = 20000;
- private static final String DEFAULT_HOST = "localhost";
+ public static final int DEFAULT_PORT = 20000;
+ public static final String DEFAULT_HOST = "localhost";
private int port;
private String host;
@@ -63,27 +72,30 @@
}
public ListenerRef createListener(Endpoint endpoint, HttpSpec transportProperties)
- {
+ {
Servlet listener = new EndpointServlet(endpoint);
this.httpDeamon.addServletContext(
transportProperties.getWebContext(),
transportProperties.getUrlPattern(),
listener
);
-
+
return createListenerRef(transportProperties);
}
private ListenerRef createListenerRef(HttpSpec transportProperties)
{
-
+
assert transportProperties.getWebContext().startsWith("/");
-
+ assert transportProperties.getUrlPattern()!=null;
+
try
{
String ctx = transportProperties.getWebContext();
- URI address = new URI("http://"+host+":"+port + ctx);
- return new HttpListenerRef(ctx, address);
+ String urlPattern = transportProperties.getUrlPattern();
+
+ URI address = new URI("http://"+host+":"+port + ctx + urlPattern);
+ return new HttpListenerRef(ctx, urlPattern, address);
} catch (URISyntaxException e)
{
throw new RuntimeException("Failed to create ListenerRef");
@@ -92,19 +104,37 @@
public void destroyListener(ListenerRef ref)
{
-
+ String context = ref.getUUID().substring(0, ref.getUUID().lastIndexOf("/"));
+ String urlPattern = ref.getUUID().substring(ref.getUUID().lastIndexOf("/"));
+ this.httpDeamon.removeServletContext(context, urlPattern);
}
+ /**
+ * Core listener component
+ */
public class EndpointServlet extends HttpServlet
{
- ObjectName endpointName;
+ // provide logging
+ private final Logger log = Logger.getLogger(EndpointServlet.class);
+ protected Endpoint endpoint;
+ protected EndpointRegistry epRegistry;
+
+ private boolean started;
+
+ public void init(ServletConfig servletConfig) throws ServletException
+ {
+ super.init(servletConfig);
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ epRegistry = spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+ }
+
public EndpointServlet(Endpoint endpoint)
{
if(null==endpoint.getName())
throw new IllegalArgumentException("Endpoint objectName is null");
-
- this.endpointName = endpoint.getName();
+
+ this.endpoint = endpoint;
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
@@ -112,14 +142,37 @@
{
response.setContentType("text/plain");
response.setStatus(HttpServletResponse.SC_OK);
- response.getWriter().println(endpointName);
+ response.getWriter().println(endpoint.getName());
}
+ public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ // arguable solution ...
+ // the endpoint should be started when the transport listener is created
+ if(!started) startEndpoint();
- protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
- throws ServletException, IOException
+ try
+ {
+ EndpointAssociation.setEndpoint(endpoint);
+ RequestHandler requestHandler = endpoint.getRequestHandler();
+ requestHandler.handleHttpRequest(endpoint, req, res, getServletContext());
+ }
+ finally
+ {
+ EndpointAssociation.removeEndpoint();
+ }
+ }
+
+ private void startEndpoint()
{
- throw new ServletException("POST not yet implemented");
- }
+ // Start the endpoint
+ Deployment dep = endpoint.getService().getDeployment();
+ if (dep.getType() == Deployment.DeploymentType.JAXRPC_JSE ||
+ dep.getType() == Deployment.DeploymentType.JAXWS_JSE)
+ {
+ if (endpoint.getState() == Endpoint.EndpointState.CREATED)
+ endpoint.getLifecycleHandler().start(endpoint);
+ }
+ }
}
}
Modified: framework/branches/hbraun/version.properties
===================================================================
--- framework/branches/hbraun/version.properties 2008-03-08 19:49:28 UTC (rev 5897)
+++ framework/branches/hbraun/version.properties 2008-03-08 19:49:51 UTC (rev 5898)
@@ -15,7 +15,7 @@
# Thirdparty library versions
jbossws-common=snapshot
-jbossws-spi=1.1.0.DEV
+jbossws-spi=snapshot
junit=3.8.1
dom4j=1.6.1
16 years, 3 months
JBossWS SVN: r5897 - in stack/native/branches/hbraun: src/main/java/org/jboss/wsf/stack/jbws/standalone and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-03-08 14:49:28 -0500 (Sat, 08 Mar 2008)
New Revision: 5897
Added:
stack/native/branches/hbraun/native-standalone.iml
Modified:
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java
stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java
Log:
Added remove endpoint hooks
Added: stack/native/branches/hbraun/native-standalone.iml
===================================================================
--- stack/native/branches/hbraun/native-standalone.iml (rev 0)
+++ stack/native/branches/hbraun/native-standalone.iml 2008-03-08 19:49:28 UTC (rev 5897)
@@ -0,0 +1,588 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/output/classes" />
+ <exclude-output />
+ <output-test url="file://$MODULE_DIR$/output/test/classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test-framework/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources/tools" isTestSource="false" packagePrefix="org.jboss.test.ws" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="framework-3.0" />
+ <orderEntry type="module" module-name="spi-3.0" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbosssx-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxb-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-xml-binding-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/xalan.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-jboss42-resources.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-common.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-xml-binding.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/xmlsec.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/xercesImpl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/commons-logging.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-common-core-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-javaee.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/resolver.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-jaxb-intros.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/xml-apis.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-jboss421.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/getopt.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-deployers.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/junit.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-vfs.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-j2ee.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxen.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/qdox.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/ant.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-logging-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/hibernate3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-remoting.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxb-impl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-deployers-src.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/serializer.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/mail.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-framework-scripts.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/concurrent.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbosssx-src.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-microcontainer-src.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/streambuffer.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-common-core.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/servlet-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-microcontainer.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/policy.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/dom4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/stax-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-remoting-src.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/activation.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-common-src.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-vfs-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/wsdl4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-dependency.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-dependency-src.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-container.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/commons-collections.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/javassist.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbosssx.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-framework-src.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-logging-log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/output/lib/jbossws-standalone.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/output/lib/jboss-jaxws-ext.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/output/lib/jboss-saaj.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/output/lib/jboss-jaxrpc.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/output/lib/jbossws-core.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/output/lib/jboss-jaxws.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/output/lib/jbossws-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Modified: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java 2008-03-08 19:08:49 UTC (rev 5896)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java 2008-03-08 19:49:28 UTC (rev 5897)
@@ -34,29 +34,47 @@
public class HttpEndpointPublishAspect extends DeploymentAspect
{
+ private SPIProvider spi;
+ private TransportManagerFactory tmf;
+ private TransportManager<HttpSpec> http;
+
+ public HttpEndpointPublishAspect()
+ {
+ spi = SPIProviderResolver.getInstance().getProvider();
+ tmf = spi.getSPI(TransportManagerFactory.class);
+ http = tmf.createTransportManager(Protocol.HTTP);
+ }
+
public void start(Deployment dep)
{
String webcontext = dep.getService().getContextRoot();
assert webcontext!=null;
assert dep.getService().getEndpoints().size()>0;
- Endpoint endpoint = dep.getService().getEndpoints().get(0);
- String urlPattern = endpoint.getURLPattern();
+ for(Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ String urlPattern = endpoint.getURLPattern();
- SPIProvider spi = SPIProviderResolver.getInstance().getProvider();
- TransportManagerFactory tmf = spi.getSPI(TransportManagerFactory.class);
- TransportManager<HttpSpec> http = tmf.createTransportManager(Protocol.HTTP);
+ HttpSpec spec = new HttpSpec(webcontext, urlPattern);
+ ListenerRef ref = this.http.createListener(endpoint, spec);
- HttpSpec spec = new HttpSpec(webcontext, urlPattern);
- ListenerRef ref = http.createListener(endpoint, spec);
-
- // Update endpoint address
- endpoint.setAddress(ref.getAddress().toString());
- endpoint.addAttachment(ListenerRef.class, ref);
+ // Update endpoint address
+ endpoint.setAddress(ref.getAddress().toString());
+ endpoint.addAttachment(ListenerRef.class, ref);
+ }
}
public void stop(Deployment dep)
{
- super.stop(dep);
+ assert dep.getService().getEndpoints().size()>0;
+
+ for(Endpoint endpoint : dep.getService().getEndpoints())
+ {
+ ListenerRef ref = endpoint.getAttachment(ListenerRef.class);
+ assert ref!=null;
+
+ this.http.destroyListener(ref);
+ }
+
}
}
Modified: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java 2008-03-08 19:08:49 UTC (rev 5896)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java 2008-03-08 19:49:28 UTC (rev 5897)
@@ -21,22 +21,15 @@
*/
package org.jboss.wsf.stack.jbws.standalone;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.registry.KernelBus;
+import org.jboss.wsf.spi.Container;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.Container;
-import org.jboss.wsf.spi.transport.TransportManager;
-import org.jboss.wsf.spi.transport.HttpSpec;
-import org.jboss.wsf.spi.transport.TransportManagerFactory;
-import org.jboss.wsf.spi.transport.Protocol;
-import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.kernel.spi.registry.KernelBus;
import java.net.URL;
@@ -54,8 +47,6 @@
private KernelController controller;
private KernelBus bus;
- private EndpointRegistry registry;
- private TransportManager<HttpSpec> httpTransport;
private DeploymentAspectManager deploymentManager;
private StandaloneContainer(Kernel kernel, KernelController controller, KernelBus bus)
@@ -79,49 +70,20 @@
}
private void assemble()
- {
- // Registry
- EndpointRegistryFactory erf = spi.getSPI(EndpointRegistryFactory.class);
- registry = erf.getEndpointRegistry();
-
- // Http Transport
- TransportManagerFactory tmf = spi.getSPI(TransportManagerFactory.class);
- httpTransport = tmf.createTransportManager(Protocol.HTTP);
-
- // DeploymentAspcetManager
+ {
+ // DeploymentAspectManager
DeploymentAspectManagerFactory daf = spi.getSPI(DeploymentAspectManagerFactory.class);
deploymentManager = daf.getDeploymentAspectManager("WSDeploymentAspectManagerJSE");
}
public void publish(Deployment deployment)
{
- /*
- 1. create runtime model (deployment aspects)
- 2. add request handler
- 3. add invocation handler
- 4. register endpoint
- 5. create transport listener
- */
- deploymentManager.deploy(deployment);
-
+ deploymentManager.deploy(deployment);
}
public void remove(Deployment deployment)
{
- /*
- 1. remove transport listener
- 2. remove endpoint from registry
- */
+ deploymentManager.undeploy(deployment);
}
-
- public void publish(Endpoint endpoint)
- {
-
- }
-
- public void remove(Endpoint endpoint)
- {
-
- }
}
\ No newline at end of file
Modified: stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java
===================================================================
--- stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java 2008-03-08 19:08:49 UTC (rev 5896)
+++ stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java 2008-03-08 19:49:28 UTC (rev 5897)
@@ -36,13 +36,13 @@
import org.jboss.wsf.stack.jbws.standalone.EmbeddedBootstrap;
import org.jboss.wsf.stack.jbws.standalone.StandaloneContainer;
+import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import javax.xml.namespace.QName;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
-import java.io.IOException;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -133,6 +133,17 @@
HelloWorldSEI port = service.getPort(HelloWorldSEI.class);
String response = port.hello("StandaloneContainer");
assertEquals("Hello StandaloneContainer", response);
+
+ // Undeploy
+ container.remove(dep);
+ try
+ {
+ wsdl = GETRequest("/hello/endpoint?wsdl");
+ } catch (IOException e)
+ {
+ //
+ }
+ assertNull("Endpoint not removed", wsdl);
}
public static String GETRequest(String context)
16 years, 3 months
JBossWS SVN: r5896 - in stack/native/branches/hbraun: src/main/java/org/jboss/wsf/stack/jbws and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-03-08 14:08:49 -0500 (Sat, 08 Mar 2008)
New Revision: 5896
Added:
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/EmbeddedBootstrap.java
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/InvocationHandlerJSE.java
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/JSEInvocationHandlerFactory.java
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/NoopWebServiceContextFactory.java
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneServerConfig.java
stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/standalone-config.xml
stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/
stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/
stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/
stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.invocation.WebServiceContextFactory
stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/
stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java
stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldEndpoint.java
stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldSEI.java
Modified:
stack/native/branches/hbraun/build.xml
Log:
Embedded container first cut
Modified: stack/native/branches/hbraun/build.xml
===================================================================
--- stack/native/branches/hbraun/build.xml 2008-03-08 19:07:17 UTC (rev 5895)
+++ stack/native/branches/hbraun/build.xml 2008-03-08 19:08:49 UTC (rev 5896)
@@ -154,6 +154,12 @@
<classpath path="${core.output.classes14.dir}"/>
<classpath refid="thirdparty.classpath"/>
</javac>
+
+ <copy todir="${core.output.classes.dir}">
+ <fileset dir="${core.java.dir}">
+ <include name="**/*.xml"/>
+ </fileset>
+ </copy>
</target>
<!-- Compile etc files (manifests and such) -->
@@ -257,7 +263,7 @@
<jar jarfile="${core.output.lib.dir}/jbossws-core.jar" manifest="${core.output.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/annotation/**"/>
- <include name="org/jboss/wsf/stack/jbws/**"/>
+ <include name="org/jboss/wsf/stack/jbws/*"/>
<include name="org/jboss/ws/**"/>
</fileset>
<fileset dir="${core.resources.dir}">
@@ -267,7 +273,17 @@
<metainf dir="${core.resources.dir}/jbossws-core.jar/META-INF"/>
</jar>
- <!-- Build jbossws-client.jar -->
+ <!-- Build jbossws-standalone.jar -->
+ <mkdir dir="${core.output.lib.dir}"/>
+ <jar jarfile="${core.output.lib.dir}/jbossws-standalone.jar" manifest="${core.output.etc.dir}/default.mf">
+ <fileset dir="${core.output.classes.dir}">
+ <include name="org/jboss/wsf/stack/jbws/standalone/**"/>
+ </fileset>
+ <metainf dir="${core.resources.dir}/jbossws-standalone.jar/META-INF"/>
+ </jar>
+
+
+ <!-- Build jbossws-client.jar -->
<jar jarfile="${core.output.lib.dir}/jbossws-client.jar" manifest="${core.output.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/wsf/**"/>
Added: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/EmbeddedBootstrap.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/EmbeddedBootstrap.java (rev 0)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/EmbeddedBootstrap.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -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.stack.jbws.standalone;
+
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+
+import java.net.URL;
+
+/**
+ * Add a BasicXMLDeployer to the BasicBootstrap so that we can parse
+ * XML descriptors for the beans (*-beans.xml).
+ *
+ * @author <a href="mailto:mark.newton@jboss.org">Mark Newton</a>
+ */
+public class EmbeddedBootstrap extends BasicBootstrap
+{
+
+ protected BasicXMLDeployer deployer;
+
+ public EmbeddedBootstrap() throws Exception {
+ super();
+ }
+
+ public void bootstrap() throws Throwable {
+ super.bootstrap();
+ deployer = new BasicXMLDeployer(getKernel());
+ Runtime.getRuntime().addShutdownHook(new Shutdown());
+ }
+
+ public void deploy(URL url) {
+ try {
+ // Workaround the fact that the BasicXMLDeployer does not handle redeployment correctly
+ if (deployer.getDeploymentNames().contains(url.toString())) {
+ System.out.println("Service is already deployed.");
+ return;
+ }
+ deployer.deploy(url);
+ } catch (Throwable t) {
+ throw new RuntimeException("Error during deployment: " + url, t);
+ }
+ }
+
+ public void undeploy(URL url) {
+ if (!deployer.getDeploymentNames().contains(url.toString())) {
+ System.out.println("Service is already undeployed.");
+ return;
+ }
+ try {
+ deployer.undeploy(url);
+ } catch (Throwable t) {
+ throw new RuntimeException("Error during undeployment: " + url, t);
+ }
+ }
+
+ protected class Shutdown extends Thread {
+ public void run() {
+ log.info("Shutting down");
+ deployer.shutdown();
+ }
+ }
+}
\ No newline at end of file
Property changes on: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/EmbeddedBootstrap.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java (rev 0)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -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.stack.jbws.standalone;
+
+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.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.transport.*;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class HttpEndpointPublishAspect extends DeploymentAspect
+{
+
+ public void start(Deployment dep)
+ {
+ String webcontext = dep.getService().getContextRoot();
+ assert webcontext!=null;
+ assert dep.getService().getEndpoints().size()>0;
+
+ Endpoint endpoint = dep.getService().getEndpoints().get(0);
+ String urlPattern = endpoint.getURLPattern();
+
+ SPIProvider spi = SPIProviderResolver.getInstance().getProvider();
+ TransportManagerFactory tmf = spi.getSPI(TransportManagerFactory.class);
+ TransportManager<HttpSpec> http = tmf.createTransportManager(Protocol.HTTP);
+
+ HttpSpec spec = new HttpSpec(webcontext, urlPattern);
+ ListenerRef ref = http.createListener(endpoint, spec);
+
+ // Update endpoint address
+ endpoint.setAddress(ref.getAddress().toString());
+ endpoint.addAttachment(ListenerRef.class, ref);
+ }
+
+ public void stop(Deployment dep)
+ {
+ super.stop(dep);
+ }
+}
Property changes on: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/HttpEndpointPublishAspect.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/InvocationHandlerJSE.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/InvocationHandlerJSE.java (rev 0)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/InvocationHandlerJSE.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1,112 @@
+/*
+ * 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.stack.jbws.standalone;
+
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+import org.jboss.wsf.spi.invocation.Invocation;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.common.JavaUtils;
+
+import javax.xml.ws.WebServiceContext;
+import java.lang.reflect.Method;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class InvocationHandlerJSE extends InvocationHandler
+{
+ public InvocationHandlerJSE()
+ {
+ }
+
+ public Invocation createInvocation()
+ {
+ return new Invocation();
+ }
+
+ public void init(Endpoint ep)
+ {
+ }
+
+ protected Object getTargetBean(Endpoint ep, Invocation epInv)
+ {
+ InvocationContext invCtx = epInv.getInvocationContext();
+ Object targetBean = invCtx.getTargetBean();
+ if (targetBean == null)
+ {
+ try
+ {
+ Class epImpl = ep.getTargetBeanClass();
+ targetBean = epImpl.newInstance();
+ invCtx.setTargetBean(targetBean);
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot get target bean instance", ex);
+ }
+ }
+ return targetBean;
+ }
+
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
+ {
+ try
+ {
+ Object targetBean = getTargetBean(ep, epInv);
+
+ InvocationContext invContext = epInv.getInvocationContext();
+ WebServiceContext wsContext = invContext.getAttachment(WebServiceContext.class);
+ if (wsContext != null)
+ {
+ // TODO: ResourceInjection not supported
+ }
+
+ Method method = getImplMethod(targetBean.getClass(), epInv.getJavaMethod());
+ Object retObj = method.invoke(targetBean, epInv.getArgs());
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+
+ protected Method getImplMethod(Class implClass, Method seiMethod) throws ClassNotFoundException, NoSuchMethodException
+ {
+ String methodName = seiMethod.getName();
+ Class[] paramTypes = seiMethod.getParameterTypes();
+ for (int i = 0; i < paramTypes.length; i++)
+ {
+ Class paramType = paramTypes[i];
+ if (JavaUtils.isPrimitive(paramType) == false)
+ {
+ String paramTypeName = paramType.getName();
+ paramType = JavaUtils.loadJavaType(paramTypeName);
+ paramTypes[i] = paramType;
+ }
+ }
+
+ Method implMethod = implClass.getMethod(methodName, paramTypes);
+ return implMethod;
+ }
+}
\ No newline at end of file
Property changes on: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/InvocationHandlerJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/JSEInvocationHandlerFactory.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/JSEInvocationHandlerFactory.java (rev 0)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/JSEInvocationHandlerFactory.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -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.stack.jbws.standalone;
+
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
+import org.jboss.wsf.spi.invocation.InvocationType;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class JSEInvocationHandlerFactory extends InvocationHandlerFactory
+{
+ public InvocationHandler newInvocationHandler(InvocationType type)
+ {
+ InvocationHandler handler = null;
+
+ switch(type)
+ {
+ case JAXWS_JSE:
+ handler = new InvocationHandlerJSE();
+ break;
+ }
+
+ if(null == handler)
+ throw new IllegalArgumentException("Unable to resolve spi.invocation.InvocationHandler for type " +type);
+
+ return handler;
+ }
+
+}
+
Added: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/NoopWebServiceContextFactory.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/NoopWebServiceContextFactory.java (rev 0)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/NoopWebServiceContextFactory.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -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.stack.jbws.standalone;
+
+import org.jboss.wsf.spi.invocation.ExtensibleWebServiceContext;
+import org.jboss.wsf.spi.invocation.InvocationType;
+import org.jboss.wsf.spi.invocation.WebServiceContextFactory;
+
+import javax.xml.ws.handler.MessageContext;
+import java.security.Principal;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class NoopWebServiceContextFactory extends WebServiceContextFactory
+{
+ final static ExtensibleWebServiceContext NOOP_CONTEXT = new NoopWebServiceContext(null);
+
+ public ExtensibleWebServiceContext newWebServiceContext(InvocationType type, MessageContext messageContext)
+ {
+ return NOOP_CONTEXT;
+ }
+
+ static class NoopWebServiceContext extends ExtensibleWebServiceContext
+ {
+
+ public NoopWebServiceContext(MessageContext messageContext)
+ {
+ super(messageContext);
+ }
+
+ public Principal getUserPrincipal()
+ {
+ throw new RuntimeException("Noop");
+ }
+
+ public boolean isUserInRole(String role)
+ {
+ throw new RuntimeException("Noop");
+ }
+ }
+}
Property changes on: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/NoopWebServiceContextFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java (rev 0)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1,127 @@
+/*
+ * 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.stack.jbws.standalone;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.Container;
+import org.jboss.wsf.spi.transport.TransportManager;
+import org.jboss.wsf.spi.transport.HttpSpec;
+import org.jboss.wsf.spi.transport.TransportManagerFactory;
+import org.jboss.wsf.spi.transport.Protocol;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.registry.KernelBus;
+
+import java.net.URL;
+
+/**
+ * A JBossWS container that bootstraps through
+ * the {@link org.jboss.wsf.spi.SPIProvider}
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class StandaloneContainer implements Container
+{
+ private SPIProvider spi;
+
+ private Kernel kernel;
+ private KernelController controller;
+ private KernelBus bus;
+
+ private EndpointRegistry registry;
+ private TransportManager<HttpSpec> httpTransport;
+ private DeploymentAspectManager deploymentManager;
+
+ private StandaloneContainer(Kernel kernel, KernelController controller, KernelBus bus)
+ {
+ this.kernel = kernel;
+ this.controller = controller;
+ this.bus = bus;
+ this.spi = SPIProviderResolver.getInstance().getProvider();
+ }
+
+ public static StandaloneContainer bootstrap(URL jbosswsBeansXml) throws Exception
+ {
+ EmbeddedBootstrap bootstrap = new EmbeddedBootstrap();
+ bootstrap.run();
+ bootstrap.deploy(jbosswsBeansXml);
+
+ Kernel kernel = bootstrap.getKernel();
+ StandaloneContainer container = new StandaloneContainer(kernel, kernel.getController(), kernel.getBus());
+ container.assemble();
+ return container;
+ }
+
+ private void assemble()
+ {
+ // Registry
+ EndpointRegistryFactory erf = spi.getSPI(EndpointRegistryFactory.class);
+ registry = erf.getEndpointRegistry();
+
+ // Http Transport
+ TransportManagerFactory tmf = spi.getSPI(TransportManagerFactory.class);
+ httpTransport = tmf.createTransportManager(Protocol.HTTP);
+
+ // DeploymentAspcetManager
+ DeploymentAspectManagerFactory daf = spi.getSPI(DeploymentAspectManagerFactory.class);
+ deploymentManager = daf.getDeploymentAspectManager("WSDeploymentAspectManagerJSE");
+ }
+
+ public void publish(Deployment deployment)
+ {
+ /*
+ 1. create runtime model (deployment aspects)
+ 2. add request handler
+ 3. add invocation handler
+ 4. register endpoint
+ 5. create transport listener
+ */
+ deploymentManager.deploy(deployment);
+
+ }
+
+ public void remove(Deployment deployment)
+ {
+ /*
+ 1. remove transport listener
+ 2. remove endpoint from registry
+ */
+ }
+
+
+ public void publish(Endpoint endpoint)
+ {
+
+ }
+
+ public void remove(Endpoint endpoint)
+ {
+
+ }
+}
\ No newline at end of file
Property changes on: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneContainer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneServerConfig.java
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneServerConfig.java (rev 0)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneServerConfig.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1,94 @@
+/*
+ * 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.stack.jbws.standalone;
+
+import org.jboss.wsf.spi.management.ServerConfig;
+
+import java.io.File;
+import java.net.UnknownHostException;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class StandaloneServerConfig implements ServerConfig
+{
+
+ public String getImplementationTitle()
+ {
+ return "JBossWS Standalone";
+ }
+
+ public String getImplementationVersion()
+ {
+ return "3.0.0";
+ }
+
+ public File getServerTempDir()
+ {
+ return new File("/tmp"); // TODO: change to default
+ }
+
+ public File getServerDataDir()
+ {
+ return new File("/tmp"); //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getWebServiceHost()
+ {
+ return "localhost"; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void setWebServiceHost(String host) throws UnknownHostException
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public int getWebServicePort()
+ {
+ return 20000; // introduce constant
+ }
+
+ public void setWebServicePort(int port)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public int getWebServiceSecurePort()
+ {
+ return 20001; // TODO: constant
+ }
+
+ public void setWebServiceSecurePort(int port)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isModifySOAPAddress()
+ {
+ return true;
+ }
+
+ public void setModifySOAPAddress(boolean flag)
+ {
+
+ }
+}
Property changes on: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/StandaloneServerConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/standalone-config.xml
===================================================================
--- stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/standalone-config.xml (rev 0)
+++ stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/standalone-config.xml 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ ======================================================================
+ SPI Implementations
+ ======================================================================
+ -->
+
+ <bean name="WSKernelLocator" class="org.jboss.wsf.spi.util.KernelLocator">
+ <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
+ </bean>
+
+ <bean name="WSServerConfig" class="org.jboss.wsf.stack.jbws.standalone.StandaloneServerConfig">
+ <property name="webServiceHost">localhost</property>
+ <property name="modifySOAPAddress">true</property>
+ </bean>
+
+ <!-- The registry for web service endpoints -->
+ <bean name="WSEndpointRegistry" class="org.jboss.wsf.framework.management.DefaultEndpointRegistry"/>
+
+ <!--
+ ======================================================================
+ Standalone DeploymentAspectManager
+ ======================================================================
+ -->
+
+ <bean name="WSDeploymentAspectManagerJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
+ <property name="name">WSDeploymentAspectManagerJSE</property>
+ </bean>
+
+ <!--
+ ======================================================================
+ Container deployment aspects
+ ======================================================================
+ -->
+
+ <bean name="WSEndpointLifecycleDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect">
+ <property name="requires">LAST_DEPLOYMENT_ASPECT</property>
+ </bean>
+
+ <bean name="WSEndpointRegistryDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointRegistryDeploymentAspect">
+ <property name="provides">RegisteredEndpoint</property>
+ </bean>
+
+ <bean name="WSHttpTransportDeploymentAspect" class="org.jboss.wsf.stack.jbws.standalone.HttpEndpointPublishAspect">
+ <property name="requires">RegisteredEndpoint</property>
+ <property name="provides">HttpTransport</property>
+ </bean>
+
+ <bean name="WSDeploymentAspectInstallerJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
+ <property name="manager"><inject bean="WSDeploymentAspectManagerJSE"/></property>
+ <property name="sortAspectsOnCreate">false</property>
+ <property name="aspects">
+ <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
+ <inject bean="WSEndpointRegistryDeploymentAspect"/>
+ <inject bean="WSEndpointLifecycleDeploymentAspect"/>
+ </set>
+ </property>
+ </bean>
+
+ <!--
+ ==============================================================================
+ Stack deployment aspects
+ ==============================================================================
+ -->
+
+ <bean name="WSNativeEagerInitializeDeploymentAspect" class="org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect">
+ <property name="requires">UnifiedMetaDataModel</property>
+ <property name="provides">InitializedMetaDataModel</property>
+ </bean>
+
+ <bean name="WSNativeEndpointHandlerDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect">
+ <!--property name="requires">ContainerEndpointHandler, ContainerMetaData</property-->
+ <property name="provides">StackEndpointHandler</property>
+ </bean>
+
+ <bean name="WSNativeEventingDeploymentAspect" class="org.jboss.wsf.stack.jbws.EventingDeploymentAspect">
+ <property name="requires">UnifiedMetaDataModel</property>
+ </bean>
+
+ <bean name="WSNativePublishContractDeploymentAspect" class="org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect">
+ <property name="requires">UnifiedMetaDataModel</property>
+ <property name="provides">PublishedContract</property>
+ </bean>
+
+ <bean name="WSNativeServiceEndpointInvokerDeploymentAspect" class="org.jboss.wsf.stack.jbws.ServiceEndpointInvokerDeploymentAspect">
+ <property name="requires">UnifiedMetaDataModel</property>
+ </bean>
+
+ <bean name="WSNativeRMDeploymentAspect" class="org.jboss.ws.extensions.wsrm.server.RMDeploymentAspect">
+ <property name="requires">StackEndpointHandler, UnifiedMetaDataModel</property>
+ </bean>
+
+ <bean name="WSNativeUnifiedMetaDataDeploymentAspect" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect">
+ <property name="provides">UnifiedMetaDataModel</property>
+ </bean>
+
+ <!-- Deployment aspect installer -->
+
+ <bean name="WSNativeDeploymentAspectInstallerJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
+ <property name="manager"><inject bean="WSDeploymentAspectManagerJSE"/></property>
+ <property name="sortAspectsOnCreate">true</property>
+ <property name="aspects">
+ <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
+ <inject bean="WSNativeEndpointHandlerDeploymentAspect"/>
+ <inject bean="WSNativeEventingDeploymentAspect"/>
+ <inject bean="WSNativePublishContractDeploymentAspect"/>
+ <inject bean="WSNativeServiceEndpointInvokerDeploymentAspect"/>
+ <inject bean="WSNativeRMDeploymentAspect"/>
+ <inject bean="WSNativeUnifiedMetaDataDeploymentAspect"/>
+ <inject bean="WSNativeEagerInitializeDeploymentAspect"/>
+ <inject bean="WSHttpTransportDeploymentAspect"/>
+ </set>
+ </property>
+ <depends>WSDeploymentAspectManagerJSE</depends>
+ </bean>
+
+ <!--
+ ==============================================================================
+ Stack specific beans (not SPI)
+ ==============================================================================
+ -->
+
+ <!-- A subscription manager for WS-Eventing -->
+ <bean name="WSSubscriptionManager" class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager">
+ <property name="bindAddress">localhost</property>
+ </bean>
+
+</deployment>
Property changes on: stack/native/branches/hbraun/src/main/java/org/jboss/wsf/stack/jbws/standalone/standalone-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
===================================================================
--- stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory (rev 0)
+++ stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1 @@
+org.jboss.wsf.framework.deployment.ArchiveDeploymentModelFactory
\ No newline at end of file
Added: stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
===================================================================
--- stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory (rev 0)
+++ stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.jbws.standalone.JSEInvocationHandlerFactory
\ No newline at end of file
Added: stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.invocation.WebServiceContextFactory
===================================================================
--- stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.invocation.WebServiceContextFactory (rev 0)
+++ stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.invocation.WebServiceContextFactory 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.jbws.standalone.NoopWebServiceContextFactory
\ No newline at end of file
Added: stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
===================================================================
--- stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory (rev 0)
+++ stack/native/branches/hbraun/src/main/resources/jbossws-standalone.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1 @@
+org.jboss.wsf.framework.management.ServerConfigFactoryImpl
\ No newline at end of file
Added: stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java
===================================================================
--- stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java (rev 0)
+++ stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1,160 @@
+/*
+ * 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.test.ws.container;
+
+import junit.framework.TestCase;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.registry.KernelBus;
+import org.jboss.wsf.common.ResourceLoaderAdapter;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.stack.jbws.standalone.EmbeddedBootstrap;
+import org.jboss.wsf.stack.jbws.standalone.StandaloneContainer;
+
+import javax.xml.ws.Service;
+import javax.xml.namespace.QName;
+import java.net.URL;
+import java.net.URLConnection;
+import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ContainerTestCase extends TestCase
+{
+ private URL standaloneConfig;
+
+ protected void setUp() throws Exception
+ {
+ ClassLoader cl = org.jboss.wsf.stack.jbws.standalone.StandaloneContainer.class.getClassLoader();
+ String config = "org/jboss/wsf/stack/jbws/standalone/standalone-config.xml";
+ standaloneConfig = cl.getResource(config);
+ if(null==standaloneConfig)
+ throw new RuntimeException("Unable to read config: "+config);
+ }
+
+ /**
+ * Check if the bootstrap in setup() works correctly
+ * @throws Exception
+ */
+ public void testBootStrap() throws Exception
+ {
+ EmbeddedBootstrap bootstrap = new EmbeddedBootstrap();
+ bootstrap.run();
+ bootstrap.deploy(standaloneConfig);
+
+ Kernel kernel = bootstrap.getKernel();
+ KernelController controller = kernel.getController();
+ KernelBus bus = kernel.getBus();
+
+ String beanName = "WSNativeDeploymentAspectInstallerJSE";
+ ControllerContext context = controller.getInstalledContext(beanName);
+ assertNotNull("Unable to retrieve "+beanName, context);
+
+ System.out.println("WSDeploymentAspectManagerJSE: " + context.getTarget());
+ }
+
+ /**
+ * During instantation the the standalone container
+ * goes through the SPIProvider to get all required {@link org.jboss.wsf.spi.SPIView}'s
+ * to properly staff itself.
+ * However this requires a successfully bootstrapped container.
+ * @throws Exception
+ */
+ public void testEmbeddedContainer() throws Exception
+ {
+ SPIProvider spi = SPIProviderResolver.getInstance().getProvider();
+ DeploymentModelFactory modelFactory = spi.getSPI(DeploymentModelFactory.class);
+
+ // Deployment
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ Deployment dep = modelFactory.newDeployment("HelloWorldDeployment", contextClassLoader);
+ dep.setRuntimeClassLoader(contextClassLoader);
+
+ // TODO: Hack, should this become another DeploymentAspect?
+ ((ArchiveDeployment)dep).setRootFile(new ResourceLoaderAdapter());
+
+ dep.setType(Deployment.DeploymentType.JAXWS_JSE);
+ dep.setService(modelFactory.newService());
+
+ // Service
+ dep.getService().setContextRoot("/hello");
+
+ // Endpoint
+ Endpoint endpoint = modelFactory.newEndpoint("org.jboss.test.ws.container.HelloWorldEndpoint");
+ endpoint.setShortName("hello");
+ endpoint.setURLPattern("/endpoint");
+ dep.getService().addEndpoint(endpoint);
+
+ long start = System.currentTimeMillis();
+ StandaloneContainer container = StandaloneContainer.bootstrap(standaloneConfig);
+ System.out.println("Bootstrap: " + (System.currentTimeMillis()-start) + " ms");
+ start = System.currentTimeMillis();
+ container.publish(dep);
+ System.out.println("Publish: " + (System.currentTimeMillis()-start) + " ms");
+
+
+ // OK, let's try to invoke the endpoint
+ String wsdl = GETRequest("/hello/endpoint?wsdl");
+ assertNotNull("Unable to retrieve WSDL", wsdl);
+
+ Service service = Service.create(
+ new URL("http://localhost:20000/hello/endpoint?wsdl"),
+ new QName("http://container.ws.test.jboss.org/", "HelloWorldEndpointService")
+ );
+
+ HelloWorldSEI port = service.getPort(HelloWorldSEI.class);
+ String response = port.hello("StandaloneContainer");
+ assertEquals("Hello StandaloneContainer", response);
+ }
+
+ public static String GETRequest(String context)
+ throws IOException
+ {
+ if(context.startsWith("/"))
+ context = context.substring(1);
+
+ URLConnection con = new URL("http://localhost:20000/"+context).openConnection();
+ con.connect();
+
+ BufferedReader in = new BufferedReader(
+ new InputStreamReader(
+ con.getInputStream()
+ )
+ );
+
+ String inputLine;
+ StringBuffer sb = new StringBuffer();
+ while ((inputLine = in.readLine()) != null)
+ sb.append(inputLine);
+ in.close();
+ return sb.toString();
+ }
+}
Property changes on: stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/ContainerTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldEndpoint.java
===================================================================
--- stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldEndpoint.java (rev 0)
+++ stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldEndpoint.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1,38 @@
+/*
+ * 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.test.ws.container;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@WebService
+public class HelloWorldEndpoint implements HelloWorldSEI
+{
+ @WebMethod
+ public String hello(String name)
+ {
+ return "Hello " + name;
+ }
+}
\ No newline at end of file
Property changes on: stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldSEI.java
===================================================================
--- stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldSEI.java (rev 0)
+++ stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldSEI.java 2008-03-08 19:08:49 UTC (rev 5896)
@@ -0,0 +1,33 @@
+/*
+ * 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.test.ws.container;
+
+import javax.jws.WebService;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@WebService
+public interface HelloWorldSEI
+{
+ String hello(String name);
+}
Property changes on: stack/native/branches/hbraun/src/test/java/org/jboss/test/ws/container/HelloWorldSEI.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 3 months
JBossWS SVN: r5895 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-03-08 14:07:17 -0500 (Sat, 08 Mar 2008)
New Revision: 5895
Added:
stack/native/branches/hbraun/
Log:
Create user branch
Copied: stack/native/branches/hbraun (from rev 5894, stack/native/trunk)
16 years, 3 months