JBossWS SVN: r3952 - in branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf: framework/invocation and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-07-19 10:32:24 -0400 (Thu, 19 Jul 2007)
New Revision: 3952
Added:
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ExtendableWebServiceContext.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java
Removed:
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextDummy.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextEJB.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextJSE.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/AbstractWebServiceContext.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java
Modified:
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java
Log:
Add WebServiceContext creation to InvocationModelFactory
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-07-19 14:21:55 UTC (rev 3951)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -25,6 +25,8 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.invocation.InvocationModelFactory;
+import org.jboss.wsf.spi.invocation.ResourceInjector;
+import org.jboss.wsf.framework.invocation.WebServiceContextInjector;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.framework.deployment.DeploymentModelFactoryImpl;
import org.jboss.wsf.common.ServiceLoader;
@@ -72,6 +74,10 @@
returnType = (T) factory;
}
+ else if (spiType.equals(ResourceInjector.class))
+ {
+ returnType = (T) new WebServiceContextInjector();
+ }
if(null == returnType)
log.debug("Failed to provide SPI '"+spiType+"'");
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextDummy.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextDummy.java 2007-07-19 14:21:55 UTC (rev 3951)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextDummy.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.invocation;
-
-// $Id$
-
-import java.security.Principal;
-
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.invocation.AbstractWebServiceContext;
-
-/**
- * A WebServiceContext implementation that has no access to
- * a security context.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 29-Jun-2007
- */
-public class WebServiceContextDummy extends AbstractWebServiceContext
-{
- // provide logging
- private static final Logger log = Logger.getLogger(WebServiceContextDummy.class);
-
- public WebServiceContextDummy(MessageContext msgContext)
- {
- super(msgContext);
- }
-
- @Override
- public Principal getUserPrincipal()
- {
- log.warn("No security context available");
- return null;
- }
-
- @Override
- public boolean isUserInRole(String role)
- {
- log.warn("No security context available");
- return false;
- }
-}
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextEJB.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextEJB.java 2007-07-19 14:21:55 UTC (rev 3951)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextEJB.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.invocation;
-
-// $Id$
-
-import org.jboss.wsf.spi.invocation.AbstractWebServiceContext;
-
-import java.security.Principal;
-
-import javax.ejb.EJBContext;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A WebServiceContext implementation that delegates to the EJBContext.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jan-2007
- */
-public class WebServiceContextEJB extends AbstractWebServiceContext
-{
- private EJBContext ejbContext;
-
- public WebServiceContextEJB(MessageContext msgContext, EJBContext ejbContext)
- {
- super(msgContext);
- this.ejbContext = ejbContext;
- }
-
- public Principal getUserPrincipal()
- {
- Principal principal = ejbContext.getCallerPrincipal();
- return principal;
- }
-
- public boolean isUserInRole(String role)
- {
- boolean isUserInRole = ejbContext.isCallerInRole(role);
- return isUserInRole;
- }
-}
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.framework.invocation;
+
+// $Id$
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.invocation.ResourceInjector;
+
+/**
+ * Inject the JAXWS WebServiceContext
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Jan-2007
+ */
+public class WebServiceContextInjector extends ResourceInjector
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(WebServiceContextInjector.class);
+
+ public void inject(Object instance, WebServiceContext context)
+ {
+ try
+ {
+ // scan fields that are marked with @Resource
+ Field[] fields = instance.getClass().getDeclaredFields();
+ for (Field field : fields)
+ {
+ Class type = field.getType();
+ if (type == WebServiceContext.class && field.isAnnotationPresent(Resource.class))
+ {
+ field.setAccessible(true);
+ field.set(instance, context);
+ }
+ }
+
+ // scan methods that are marked with @Resource
+ Method[] methods = instance.getClass().getDeclaredMethods();
+ for (Method method : methods)
+ {
+ Class[] paramTypes = method.getParameterTypes();
+ if (paramTypes.length == 1 && paramTypes[0] == WebServiceContext.class && method.isAnnotationPresent(Resource.class))
+ {
+ method.setAccessible(true);
+ method.invoke(instance, new Object[] { context });
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.warn("Cannot inject WebServiceContext", ex);
+ }
+ }
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextJSE.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextJSE.java 2007-07-19 14:21:55 UTC (rev 3951)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextJSE.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.invocation;
-
-// $Id$
-
-import org.jboss.wsf.spi.invocation.AbstractWebServiceContext;
-
-import java.security.Principal;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.ws.handler.MessageContext;
-
-/**
- * A WebServiceContext implementation that delegates to the HttpServletRequest.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 23-Jan-2007
- */
-public class WebServiceContextJSE extends AbstractWebServiceContext
-{
- private HttpServletRequest httpRequest;
-
- public WebServiceContextJSE(MessageContext msgContext)
- {
- super(msgContext);
- httpRequest = (HttpServletRequest)msgContext.get(MessageContext.SERVLET_REQUEST);
- if (httpRequest == null)
- throw new IllegalStateException("Cannot obtain HTTPServletRequest from message context");
- }
-
- @Override
- public Principal getUserPrincipal()
- {
- Principal principal = httpRequest.getUserPrincipal();
- return principal;
- }
-
- @Override
- public boolean isUserInRole(String role)
- {
- boolean isUserInRole = httpRequest.isUserInRole(role);
- return isUserInRole;
- }
-}
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/AbstractWebServiceContext.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/AbstractWebServiceContext.java 2007-07-19 14:21:55 UTC (rev 3951)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/AbstractWebServiceContext.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.spi.invocation;
-
-import java.security.Principal;
-
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.util.NotImplementedException;
-import org.w3c.dom.Element;
-
-/**
- * A WebServiceContext makes it possible for a web service endpoint implementation
- * class to access message context and security information relative to a request
- * being served. Typically a WebServiceContext is injected into an endpoint implementation
- * class using the Resource annotation.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-May-2006
- */
-public abstract class AbstractWebServiceContext implements WebServiceContext
-{
- private MessageContext messageContext;
-
- public AbstractWebServiceContext(MessageContext messageContext)
- {
- this.messageContext = messageContext;
- }
-
- public MessageContext getMessageContext()
- {
- return messageContext;
- }
-
- public abstract Principal getUserPrincipal();
-
- public abstract boolean isUserInRole(String role);
-
- public EndpointReference getEndpointReference(Element... referenceParameters)
- {
- throw new NotImplementedException();
- }
-
- public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters)
- {
- throw new NotImplementedException();
- }
-}
\ No newline at end of file
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java 2007-07-19 14:21:55 UTC (rev 3951)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -24,6 +24,8 @@
// $Id$
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import javax.xml.ws.WebServiceContext;
import java.lang.reflect.Method;
@@ -76,7 +78,9 @@
WebServiceContext wsContext = invContext.getAttachment(WebServiceContext.class);
if (wsContext != null)
{
- new WebServiceContextInjector().injectContext(targetBean, (WebServiceContext)wsContext);
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ ResourceInjector injector = spiProvider.getSPI(ResourceInjector.class);
+ injector.inject(targetBean, wsContext);
}
Method method = getImplMethod(targetBean.getClass(), epInv.getJavaMethod());
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ExtendableWebServiceContext.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ExtendableWebServiceContext.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ExtendableWebServiceContext.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+import java.security.Principal;
+import java.util.Map;
+import java.util.HashMap;
+
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.util.NotImplementedException;
+import org.w3c.dom.Element;
+
+/**
+ * A WebServiceContext makes it possible for a web service endpoint implementation
+ * class to access message context and security information relative to a request
+ * being served. Typically a WebServiceContext is injected into an endpoint implementation
+ * class using the Resource annotation.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 03-May-2006
+ */
+public abstract class ExtendableWebServiceContext implements WebServiceContext
+{
+ private MessageContext messageContext;
+
+ private Map<Class, Object> attachments = new HashMap<Class, Object>();
+
+ public ExtendableWebServiceContext(MessageContext messageContext)
+ {
+ this.messageContext = messageContext;
+ }
+
+ public MessageContext getMessageContext()
+ {
+ return messageContext;
+ }
+
+ public abstract Principal getUserPrincipal();
+
+ public abstract boolean isUserInRole(String role);
+
+ public EndpointReference getEndpointReference(Element... referenceParameters)
+ {
+ throw new NotImplementedException();
+ }
+
+ public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters)
+ {
+ throw new NotImplementedException();
+ }
+
+ public <T> T addAttachment(Class<T> key, Object value)
+ {
+ return (T)attachments.put(key, value);
+ }
+
+ public <T> T getAttachment(Class<T> key)
+ {
+ return (T)attachments.get(key);
+ }
+
+ public <T> T removeAttachment(Class<T> key)
+ {
+ return (T)attachments.get(key);
+ }
+}
\ No newline at end of file
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ExtendableWebServiceContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java 2007-07-19 14:21:55 UTC (rev 3951)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -23,6 +23,8 @@
import org.jboss.wsf.spi.SPIView;
+import javax.xml.ws.handler.MessageContext;
+
/**
* Creates invocation related artefacts.
*
@@ -33,4 +35,5 @@
{
public abstract InvocationHandler createInvocationHandler(InvocationType type);
public abstract InvocationContext createInvocationContext(InvocationType type);
+ public abstract ExtendableWebServiceContext createWebServiceContext(InvocationType type, MessageContext messageContext);
}
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+import org.jboss.wsf.spi.SPIView;
+
+import javax.xml.ws.WebServiceContext;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 19, 2007
+ */
+public abstract class ResourceInjector implements SPIView
+{
+ public abstract void inject(Object instance, WebServiceContext context);
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+// $Id$
+
+import org.jboss.wsf.spi.invocation.ExtendableWebServiceContext;
+
+import java.security.Principal;
+
+import javax.ejb.EJBContext;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * A WebServiceContext implementation that delegates to the EJBContext.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jan-2007
+ */
+public class WebServiceContextEJB extends ExtendableWebServiceContext
+{
+ public WebServiceContextEJB(MessageContext msgContext)
+ {
+ super(msgContext);
+ }
+
+ public Principal getUserPrincipal()
+ {
+ EJBContext ejbContext = getAttachment(EJBContext.class);
+ Principal principal = ejbContext.getCallerPrincipal();
+ return principal;
+ }
+
+ public boolean isUserInRole(String role)
+ {
+ EJBContext ejbContext = getAttachment(EJBContext.class);
+ boolean isUserInRole = ejbContext.isCallerInRole(role);
+ return isUserInRole;
+ }
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextEJB.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java 2007-07-19 14:21:55 UTC (rev 3951)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.spi.invocation;
-
-// $Id$
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.annotation.Resource;
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.logging.Logger;
-
-/**
- * Inject the JAXWS WebServiceContext
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Jan-2007
- */
-public class WebServiceContextInjector
-{
- // provide logging
- private static Logger log = Logger.getLogger(WebServiceContextInjector.class);
-
- WebServiceContextInjector()
- {
- }
-
- public void injectContext(Object epInstance, WebServiceContext wsContext)
- {
- try
- {
- // scan fields that are marked with @Resource
- Field[] fields = epInstance.getClass().getDeclaredFields();
- for (Field field : fields)
- {
- Class type = field.getType();
- if (type == WebServiceContext.class && field.isAnnotationPresent(Resource.class))
- {
- field.setAccessible(true);
- field.set(epInstance, wsContext);
- }
- }
-
- // scan methods that are marked with @Resource
- Method[] methods = epInstance.getClass().getDeclaredMethods();
- for (Method method : methods)
- {
- Class[] paramTypes = method.getParameterTypes();
- if (paramTypes.length == 1 && paramTypes[0] == WebServiceContext.class && method.isAnnotationPresent(Resource.class))
- {
- method.setAccessible(true);
- method.invoke(epInstance, new Object[] { wsContext });
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.warn("Cannot inject WebServiceContext", ex);
- }
- }
-}
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java 2007-07-19 14:32:24 UTC (rev 3952)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+// $Id$
+
+import org.jboss.wsf.spi.invocation.ExtendableWebServiceContext;
+
+import java.security.Principal;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * A WebServiceContext implementation that delegates to the HttpServletRequest.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 23-Jan-2007
+ */
+public class WebServiceContextJSE extends ExtendableWebServiceContext
+{
+ private HttpServletRequest httpRequest;
+
+ public WebServiceContextJSE(MessageContext msgContext)
+ {
+ super(msgContext);
+ httpRequest = (HttpServletRequest)msgContext.get(MessageContext.SERVLET_REQUEST);
+ if (httpRequest == null)
+ throw new IllegalStateException("Cannot obtain HTTPServletRequest from message context");
+ }
+
+ @Override
+ public Principal getUserPrincipal()
+ {
+ Principal principal = httpRequest.getUserPrincipal();
+ return principal;
+ }
+
+ @Override
+ public boolean isUserInRole(String role)
+ {
+ boolean isUserInRole = httpRequest.isUserInRole(role);
+ return isUserInRole;
+ }
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextJSE.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 5 months
JBossWS SVN: r3951 - branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-core/src/main/java/org/jboss/ws/core/server.
by jbossws-commits@lists.jboss.org
Author: david.boeren
Date: 2007-07-19 10:21:55 -0400 (Thu, 19 Jul 2007)
New Revision: 3951
Modified:
branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
Log:
Re-adding the fix for Amberpoint case 15726
Modified: branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-07-19 12:59:02 UTC (rev 3950)
+++ branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-07-19 14:21:55 UTC (rev 3951)
@@ -150,20 +150,14 @@
msgContext.setOperationMetaData(opMetaData);
oneway = opMetaData.isOneWay();
- // Unbind the request message
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
+ // We no longer call unbindRequestMessage here, per case 15726
}
handlersPass = handlersPass && callRequestHandlerChain(seInfo, HandlerType.ENDPOINT);
handlersPass = handlersPass && callRequestHandlerChain(seInfo, HandlerType.POST);
- // Check if protocol handlers modified the payload
- if (msgContext.isModified() == true)
- {
- if (log.isDebugEnabled())
- log.debug("Handler modified body payload, unbind message again");
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
+ // Unbind the request message
+ epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
if (handlersPass)
{
17 years, 5 months
JBossWS SVN: r3950 - in branches/hbraun/trunk/integration/spi/src/main/java/org/jboss: wsf/framework and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-07-19 08:59:02 -0400 (Thu, 19 Jul 2007)
New Revision: 3950
Added:
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIView.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java
Removed:
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicEndpointInvocation.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicInvocationContext.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicInvocationHandler.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/InvocationHandlerJSE.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIProvision.java
Modified:
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicDeploymentAspectManager.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicLifecycleHandler.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/transport/jms/JMSTransportSupport.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationContext.java
branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java
Log:
Introduce InvocationModelFactory
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -46,8 +46,4 @@
void setValue(ServiceRefElement ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value);
void bindServiceRef(Context encCtx, String encName, UnifiedVirtualFile vfsRoot, ClassLoader loader, ServiceRefMetaData sref) throws NamingException;
-
- void setJaxrpcBinder(ServiceRefBinder binder);
-
- void setJaxwsBinder(ServiceRefBinder binder);
}
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/DefaultSPIProviderResolver.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -23,8 +23,12 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.invocation.InvocationModelFactory;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.framework.deployment.DeploymentModelFactoryImpl;
+import org.jboss.wsf.common.ServiceLoader;
+import org.jboss.logging.Logger;
/**
* @author Heiko.Braun(a)jboss.com
@@ -32,24 +36,49 @@
*/
public class DefaultSPIProviderResolver extends SPIProviderResolver
{
+ private final static SPIProvider DEFAULT_PROVIDER = new Provider();
+
public SPIProvider getProvider()
{
- return new DefaultSPIProvider();
+ return DEFAULT_PROVIDER;
}
- public class DefaultSPIProvider extends SPIProvider
+ static class Provider extends SPIProvider
{
+ // provide logging
+ private static final Logger log = Logger.getLogger(Provider.class);
+
/**
* Gets the specified SPI.
*/
public <T> T getSPI(Class<T> spiType)
{
+ log.debug("provide SPI '"+spiType+"'");
+
+ T returnType = null;
+
if(spiType.equals(DeploymentModelFactory.class))
{
- return (T)new DeploymentModelFactoryImpl();
+ returnType = (T)new DeploymentModelFactoryImpl();
}
+ else if(spiType.equals(InvocationModelFactory.class))
+ {
+ // container integration needs to provide these
+ InvocationModelFactory factory = (InvocationModelFactory )
+ ServiceLoader.loadService(InvocationModelFactory.class.getName(), null);
- return null;
+ if(null == factory)
+ throw new WSFException("Unable to load spi.invocation.InvocationModelFactory");
+
+ returnType = (T) factory;
+ }
+
+ if(null == returnType)
+ log.debug("Failed to provide SPI '"+spiType+"'");
+ else
+ log.debug(spiType + " Implementation: " + returnType);
+
+ return returnType;
}
}
}
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicDeploymentAspectManager.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicDeploymentAspectManager.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicDeploymentAspectManager.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -120,7 +120,7 @@
}
for (DeploymentAspect aspect : sortedAspects)
- log.info(name + ": " + aspect);
+ log.debug(name + ": " + aspect);
}
return sortedAspects;
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicLifecycleHandler.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicLifecycleHandler.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/BasicLifecycleHandler.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -47,8 +47,9 @@
InvocationHandler invHandler = ep.getInvocationHandler();
if (invHandler == null)
throw new IllegalStateException("Invocation handler not available");
+
+ invHandler.init(ep);
- invHandler.create(ep);
ep.setState(EndpointState.CREATED);
}
@@ -60,8 +61,6 @@
if (state == EndpointState.UNDEFINED || state == EndpointState.DESTROYED)
throw new IllegalStateException("Cannot start endpoint in state: " + state);
- ep.getInvocationHandler().start(ep);
-
if (ep.getEndpointMetrics() != null)
ep.getEndpointMetrics().start();
@@ -76,8 +75,6 @@
if (state != EndpointState.STARTED)
throw new IllegalStateException("Cannot stop endpoint in state: " + state);
- ep.getInvocationHandler().stop(ep);
-
if (ep.getEndpointMetrics() != null)
ep.getEndpointMetrics().stop();
@@ -88,8 +85,6 @@
{
log.debug("Destroy: " + ep.getName());
- ep.getInvocationHandler().destroy(ep);
-
ep.setState(EndpointState.DESTROYED);
}
}
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -28,6 +28,8 @@
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.invocation.InvocationModelFactory;
+import org.jboss.wsf.spi.invocation.InvocationType;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.wsf.spi.metadata.j2ee.UnifiedMessageDrivenMetaData;
@@ -35,6 +37,8 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.LifecycleHandler;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.SPIProvider;
/**
* A deployer that assigns the handlers to the Endpoint
@@ -47,6 +51,7 @@
private String requestHandler;
private String lifecycleHandler;
+ // TODO: eleminate the MC registration process, finally this MAP could be removed
private Map<String, String> invocationHandlerMap = new HashMap<String, String>();
public void setLifecycleHandler(String handler)
@@ -126,20 +131,9 @@
}
}
- InvocationHandler invocationHandler = null;
- String className = invocationHandlerMap.get(key);
- if (className != null)
- {
- try
- {
- Class<?> handlerClass = dep.getInitialClassLoader().loadClass(className);
- invocationHandler = (InvocationHandler)handlerClass.newInstance();
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Cannot load invocation handler: " + className);
- }
- }
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ InvocationType type = InvocationType.valueOf(key);
+ InvocationHandler invocationHandler= spiProvider.getSPI(InvocationModelFactory.class).createInvocationHandler( type );
return invocationHandler;
}
}
\ No newline at end of file
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicEndpointInvocation.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicEndpointInvocation.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicEndpointInvocation.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.invocation;
-
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-import java.lang.reflect.Method;
-
-//$Id$
-
-/**
- * A general endpoint invocation.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicEndpointInvocation implements Invocation
-{
- private InvocationContext invocationContext;
- private Method javaMethod;
- private Object[] args;
- private Object returnValue;
-
- public BasicEndpointInvocation()
- {
- this.invocationContext = new BasicInvocationContext();
- }
-
- public InvocationContext getInvocationContext()
- {
- return invocationContext;
- }
-
- public void setInvocationContext(InvocationContext invocationContext)
- {
- this.invocationContext = invocationContext;
- }
-
- public Method getJavaMethod()
- {
- return javaMethod;
- }
-
- public void setJavaMethod(Method javaMethod)
- {
- this.javaMethod = javaMethod;
- }
-
- public Object[] getArgs()
- {
- return args;
- }
-
- public void setArgs(Object[] args)
- {
- this.args = args;
- }
-
- public Object getReturnValue()
- {
- return returnValue;
- }
-
- public void setReturnValue(Object returnValue)
- {
- this.returnValue = returnValue;
- }
-}
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicInvocationContext.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicInvocationContext.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicInvocationContext.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.invocation;
-
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A basic invocation context.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicInvocationContext implements InvocationContext
-{
- private Object targetBean;
- private Map<Class, Object> attachments = new HashMap<Class, Object>();
-
- public Object getTargetBean()
- {
- return targetBean;
- }
-
- public void setTargetBean(Object targetBean)
- {
- this.targetBean = targetBean;
- }
-
-
- public <T> T addAttachment(Class<T> key, Object value)
- {
- return (T)attachments.put(key, value);
- }
-
- public <T> T getAttachment(Class<T> key)
- {
- return (T)attachments.get(key);
- }
-
- public <T> T removeAttachment(Class<T> key)
- {
- return (T)attachments.get(key);
- }
-}
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicInvocationHandler.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicInvocationHandler.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/BasicInvocationHandler.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.invocation;
-
-// $Id$
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.UndeclaredThrowableException;
-
-import javax.management.MBeanException;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.common.JavaUtils;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.framework.invocation.BasicEndpointInvocation;
-
-/**
- * Handles invocations on endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public abstract class BasicInvocationHandler implements InvocationHandler
-{
- // provide logging
- private static final Logger log = Logger.getLogger(BasicInvocationHandler.class);
-
- public Invocation createInvocation()
- {
- return new BasicEndpointInvocation();
- }
-
- 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;
- }
-
- public void create(Endpoint ep)
- {
- log.debug("Create: " + ep.getName());
- }
-
- public void start(Endpoint ep)
- {
- log.debug("Start: " + ep.getName());
- }
-
- public void stop(Endpoint ep)
- {
- log.debug("Stop: " + ep.getName());
- }
-
- public void destroy(Endpoint ep)
- {
- log.debug("Destroy: " + ep.getName());
- }
-
- protected void handleInvocationException(Throwable th) throws Exception
- {
- if (th instanceof MBeanException)
- {
- throw ((MBeanException)th).getTargetException();
- }
-
- if (th instanceof InvocationTargetException)
- {
- // Unwrap the throwable raised by the service endpoint implementation
- Throwable targetEx = ((InvocationTargetException)th).getTargetException();
- handleInvocationException(targetEx);
- }
-
- if (th instanceof Exception)
- {
- throw (Exception)th;
- }
-
- if (th instanceof Error)
- {
- throw (Error)th;
- }
-
- throw new UndeclaredThrowableException(th);
- }
-}
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/InvocationHandlerJSE.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/InvocationHandlerJSE.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/InvocationHandlerJSE.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.invocation;
-
-// $Id$
-
-import java.lang.reflect.Method;
-
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.framework.invocation.BasicInvocationHandler;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Apr-2007
- */
-public class InvocationHandlerJSE extends BasicInvocationHandler
-{
- 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("Canot 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)
- {
- new WebServiceContextInjector().injectContext(targetBean, (WebServiceContext)wsContext);
- }
-
- Method method = getImplMethod(targetBean.getClass(), epInv.getJavaMethod());
- Object retObj = method.invoke(targetBean, epInv.getArgs());
- epInv.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- handleInvocationException(e);
- }
- }
-}
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/invocation/WebServiceContextInjector.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.framework.invocation;
-
-// $Id$
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.annotation.Resource;
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.logging.Logger;
-
-/**
- * Inject the JAXWS WebServiceContext
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Jan-2007
- */
-public class WebServiceContextInjector
-{
- // provide logging
- private static Logger log = Logger.getLogger(WebServiceContextInjector.class);
-
- public void injectContext(Object epInstance, WebServiceContext wsContext)
- {
- try
- {
- // scan fields that are marked with @Resource
- Field[] fields = epInstance.getClass().getDeclaredFields();
- for (Field field : fields)
- {
- Class type = field.getType();
- if (type == WebServiceContext.class && field.isAnnotationPresent(Resource.class))
- {
- field.setAccessible(true);
- field.set(epInstance, wsContext);
- }
- }
-
- // scan methods that are marked with @Resource
- Method[] methods = epInstance.getClass().getDeclaredMethods();
- for (Method method : methods)
- {
- Class[] paramTypes = method.getParameterTypes();
- if (paramTypes.length == 1 && paramTypes[0] == WebServiceContext.class && method.isAnnotationPresent(Resource.class))
- {
- method.setAccessible(true);
- method.invoke(epInstance, new Object[] { wsContext });
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.warn("Cannot inject WebServiceContext", ex);
- }
- }
-}
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/transport/jms/JMSTransportSupport.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/transport/jms/JMSTransportSupport.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/framework/transport/jms/JMSTransportSupport.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -23,41 +23,25 @@
// $Id:JMSTransportSupport.java 915 2006-09-08 08:40:45Z thomas.diesler(a)jboss.com $
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.rmi.RemoteException;
+import org.jboss.logging.Logger;
+import org.jboss.util.NestedRuntimeException;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import javax.ejb.EJBException;
import javax.ejb.MessageDrivenBean;
import javax.ejb.MessageDrivenContext;
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
+import javax.jms.*;
import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.xml.soap.SOAPException;
+import java.io.*;
+import java.lang.IllegalStateException;
+import java.rmi.RemoteException;
-import org.jboss.logging.Logger;
-import org.jboss.util.NestedRuntimeException;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.framework.invocation.BasicInvocationContext;
-import org.jboss.wsf.spi.invocation.RequestHandler;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-
/**
* The abstract base class for MDBs that want to act as web service endpoints.
* A subclass should only need to implement the service endpoint interface.
@@ -151,7 +135,7 @@
try
{
- BasicInvocationContext invContext = new BasicInvocationContext();
+ InvocationContext invContext = new InvocationContext();
invContext.setTargetBean(this);
reqHandler.handleRequest(endpoint, inputStream, outStream, invContext);
Deleted: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIProvision.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIProvision.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIProvision.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.spi;
-
-/**
- * Can be consumed thorugh the SPIProvider.
- * It's just a marker interface.
- *
- * @author Heiko.Braun(a)jboss.com
- * Created: Jul 18, 2007
- */
-public interface SPIProvision
-{
-}
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIView.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIView.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIView.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi;
+
+/**
+ * Marks a specific subset onto the overall SPI.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 18, 2007
+ */
+public interface SPIView
+{
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/SPIView.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/deployment/DeploymentModelFactory.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -21,13 +21,13 @@
*/
package org.jboss.wsf.spi.deployment;
-import org.jboss.wsf.spi.SPIProvision;
+import org.jboss.wsf.spi.SPIView;
/**
* @author Heiko.Braun(a)jboss.com
* Created: Jul 18, 2007
*/
-public abstract class DeploymentModelFactory implements SPIProvision
+public abstract class DeploymentModelFactory implements SPIView
{
public abstract Deployment createDeployment();
public abstract Service createService();
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+// $Id$
+
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+import javax.xml.rpc.server.ServiceLifecycle;
+import javax.xml.rpc.server.ServletEndpointContext;
+
+/**
+ * Handles invocations on JSE endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class DefaultInvocationHandlerJAXRPC extends DefaultInvocationHandlerJAXWS
+{
+ @Override
+ public void invoke(Endpoint ep, Invocation epInv) throws Exception
+ {
+ try
+ {
+ Object targetBean = getTargetBean(ep, epInv);
+
+ InvocationContext invContext = epInv.getInvocationContext();
+ if (targetBean instanceof ServiceLifecycle)
+ {
+ ServletEndpointContext sepContext = invContext.getAttachment(ServletEndpointContext.class);
+ if (sepContext != null)
+ ((ServiceLifecycle)targetBean).init(sepContext);
+ }
+
+ try
+ {
+ super.invoke(ep, epInv);
+ }
+ finally
+ {
+ if (targetBean instanceof ServiceLifecycle)
+ {
+ ((ServiceLifecycle)targetBean).destroy();
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXRPC.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+// $Id$
+
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+import javax.xml.ws.WebServiceContext;
+import java.lang.reflect.Method;
+
+/**
+ * Handles invocations on JSE endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Apr-2007
+ */
+public class DefaultInvocationHandlerJAXWS extends InvocationHandler
+{
+ 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("Canot 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)
+ {
+ new WebServiceContextInjector().injectContext(targetBean, (WebServiceContext)wsContext);
+ }
+
+ Method method = getImplMethod(targetBean.getClass(), epInv.getJavaMethod());
+ Object retObj = method.invoke(targetBean, epInv.getArgs());
+ epInv.setReturnValue(retObj);
+ }
+ catch (Exception e)
+ {
+ handleInvocationException(e);
+ }
+ }
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/DefaultInvocationHandlerJAXWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/Invocation.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -23,29 +23,61 @@
import java.lang.reflect.Method;
-//$Id$
-
/**
* A general endpoint invocation.
- *
+ *
* @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
+ * @since 20-Apr-2007
*/
-public interface Invocation
+public class Invocation
{
- InvocationContext getInvocationContext();
-
- void setInvocationContext(InvocationContext context);
-
- Method getJavaMethod();
-
- void setJavaMethod(Method method);
-
- Object[] getArgs();
-
- void setArgs(Object[] args);
-
- Object getReturnValue();
-
- void setReturnValue(Object ret);
+ private InvocationContext invocationContext;
+ private Method javaMethod;
+ private Object[] args;
+ private Object returnValue;
+
+ public Invocation()
+ {
+ this.invocationContext = new InvocationContext();
+ }
+
+ public InvocationContext getInvocationContext()
+ {
+ return invocationContext;
+ }
+
+ public void setInvocationContext(InvocationContext invocationContext)
+ {
+ this.invocationContext = invocationContext;
+ }
+
+ public Method getJavaMethod()
+ {
+ return javaMethod;
+ }
+
+ public void setJavaMethod(Method javaMethod)
+ {
+ this.javaMethod = javaMethod;
+ }
+
+ public Object[] getArgs()
+ {
+ return args;
+ }
+
+ public void setArgs(Object[] args)
+ {
+ this.args = args;
+ }
+
+ public Object getReturnValue()
+ {
+ return returnValue;
+ }
+
+ public void setReturnValue(Object returnValue)
+ {
+ this.returnValue = returnValue;
+ }
}
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationContext.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationContext.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationContext.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -21,26 +21,43 @@
*/
package org.jboss.wsf.spi.invocation;
-//$Id$
+import java.util.Map;
+import java.util.HashMap;
/**
- * A general endpoint invocation context.
- *
+ * A basic invocation context.
+ *
* @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
+ * @since 20-Apr-2007
*/
-public interface InvocationContext
+public class InvocationContext
{
- Object getTargetBean();
-
- void setTargetBean(Object targetBean);
-
- /** Add arbitrary attachments */
- <T> T addAttachment(Class<T> key, Object value);
+ private Object targetBean;
+ private Map<Class, Object> attachments = new HashMap<Class, Object>();
- /** Get arbitrary attachments */
- <T> T getAttachment(Class<T> key);
+ public Object getTargetBean()
+ {
+ return targetBean;
+ }
- /** Remove arbitrary attachments */
- <T> T removeAttachment(Class<T> key);
+ public void setTargetBean(Object targetBean)
+ {
+ this.targetBean = targetBean;
+ }
+
+
+ public <T> T addAttachment(Class<T> key, Object value)
+ {
+ return (T)attachments.put(key, value);
+ }
+
+ public <T> T getAttachment(Class<T> key)
+ {
+ return (T)attachments.get(key);
+ }
+
+ public <T> T removeAttachment(Class<T> key)
+ {
+ return (T)attachments.get(key);
+ }
}
Modified: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java 2007-07-19 12:22:59 UTC (rev 3949)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationHandler.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -21,33 +21,76 @@
*/
package org.jboss.wsf.spi.invocation;
-//$Id$
-
+import org.jboss.wsf.common.JavaUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
+import javax.management.MBeanException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.UndeclaredThrowableException;
+
/**
- * A general endpoint invocation handler.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
+ * Handles invocations on endpoints.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.com
+ * @since 25-Apr-2007
*/
-public interface InvocationHandler
+public abstract class InvocationHandler
{
- /** Create the default invokation object */
- Invocation createInvocation();
- /** Create the invocation handler */
- void create(Endpoint ep);
+ /** Create a container specific invocation **/
+ public abstract Invocation createInvocation();
- /** Start the invocation handler */
- void start(Endpoint ep);
-
/** Invoke the the service endpoint */
- void invoke(Endpoint ep, Invocation inv) throws Exception;
+ public abstract void invoke(Endpoint ep, Invocation inv) throws Exception;
- /** Stop the invocation handler */
- void stop(Endpoint ep);
+ /** Initilize the invocation handler **/
+ public abstract void init(Endpoint ep);
- /** Destroy the invocation handler */
- void destroy(Endpoint ep);
+ 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;
+ }
+
+ protected void handleInvocationException(Throwable th) throws Exception
+ {
+ if (th instanceof MBeanException)
+ {
+ throw ((MBeanException)th).getTargetException();
+ }
+
+ if (th instanceof InvocationTargetException)
+ {
+ // Unwrap the throwable raised by the service endpoint implementation
+ Throwable targetEx = ((InvocationTargetException)th).getTargetException();
+ handleInvocationException(targetEx);
+ }
+
+ if (th instanceof Exception)
+ {
+ throw (Exception)th;
+ }
+
+ if (th instanceof Error)
+ {
+ throw (Error)th;
+ }
+
+ throw new UndeclaredThrowableException(th);
+ }
}
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+import org.jboss.wsf.spi.SPIView;
+
+/**
+ * Creates invocation related artefacts.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 19, 2007
+ */
+public abstract class InvocationModelFactory implements SPIView
+{
+ public abstract InvocationHandler createInvocationHandler(InvocationType type);
+ public abstract InvocationContext createInvocationContext(InvocationType type);
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationModelFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+/**
+ * Known invocation types.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * Created: Jul 19, 2007
+ */
+public enum InvocationType
+{
+ JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_MDB21, JAXWS_JSE, JAXWS_EJB21, JAXWS_EJB3, JAXWS_MDB21, JAXWS_MDB3;
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/InvocationType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java
===================================================================
--- branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java (rev 0)
+++ branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java 2007-07-19 12:59:02 UTC (rev 3950)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.spi.invocation;
+
+// $Id$
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Inject the JAXWS WebServiceContext
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-Jan-2007
+ */
+public class WebServiceContextInjector
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(WebServiceContextInjector.class);
+
+ WebServiceContextInjector()
+ {
+ }
+
+ public void injectContext(Object epInstance, WebServiceContext wsContext)
+ {
+ try
+ {
+ // scan fields that are marked with @Resource
+ Field[] fields = epInstance.getClass().getDeclaredFields();
+ for (Field field : fields)
+ {
+ Class type = field.getType();
+ if (type == WebServiceContext.class && field.isAnnotationPresent(Resource.class))
+ {
+ field.setAccessible(true);
+ field.set(epInstance, wsContext);
+ }
+ }
+
+ // scan methods that are marked with @Resource
+ Method[] methods = epInstance.getClass().getDeclaredMethods();
+ for (Method method : methods)
+ {
+ Class[] paramTypes = method.getParameterTypes();
+ if (paramTypes.length == 1 && paramTypes[0] == WebServiceContext.class && method.isAnnotationPresent(Resource.class))
+ {
+ method.setAccessible(true);
+ method.invoke(epInstance, new Object[] { wsContext });
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.warn("Cannot inject WebServiceContext", ex);
+ }
+ }
+}
Property changes on: branches/hbraun/trunk/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/WebServiceContextInjector.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 5 months
JBossWS SVN: r3949 - in trunk/jbossws-core/src: test/java/org/jboss/test/ws/tools and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-07-19 08:22:59 -0400 (Thu, 19 Jul 2007)
New Revision: 3949
Added:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
trunk/jbossws-core/src/test/resources/tools/jbws1725/
trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
Removed:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
Log:
[JBWS-1725] Merged from branches\jbossws-2.0
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2007-07-19 12:22:59 UTC (rev 3949)
@@ -56,6 +56,7 @@
/** Class that converts a XSD Type into Java class
* @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @author mageshbk(a)jboss.com
* @since Apr 4, 2005
*/
public class XSDTypeToJava
@@ -202,7 +203,17 @@
XSSimpleTypeDefinition xssimple = type.getSimpleType();
QName q = new QName(xssimple.getNamespace(), xssimple.getName());
QName qn = schemautils.patchXSDQName(q);
- VAR v = new VAR("_value", typeMapping.getJavaType(qn).getName(), false);
+ Class javaType = typeMapping.getJavaType(qn);
+ String jtype = null;
+ if (javaType.isArray())
+ {
+ jtype = JavaUtils.getSourceName(javaType);
+ }
+ else
+ {
+ jtype = javaType.getName();
+ }
+ VAR v = new VAR("_value", jtype, false);
vars.add(v);
}
}
Copied: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725 (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725)
Deleted: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java 2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java 2007-07-19 12:22:59 UTC (rev 3949)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.tools.jbws1725;
-
-import java.io.File;
-
-import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
-import org.jboss.ws.tools.WSTools;
-import org.jboss.wsf.spi.test.JBossWSTest;
-
-/**
- * Test case for http://jira.jboss.com/jira/browse/JBWS-1725
- *
- * WSDL-JAVA Derivation of a complex type from a Simple type: bas64Binary
- * is not mapped to byte[]
- *
- * @author mageshbk(a)jboss.com
- * @since Jul 19, 2007
- */
-public class JBWS1725TestCase extends JBossWSTest
-{
-
- public void testExtensionType() throws Exception
- {
- String resourceDir = "resources/tools/jbws1725";
- String toolsDir = "tools/jbws1725";
- String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
- new WSTools().generate(args);
-
- compareSource(resourceDir + "/PasswordType.java", toolsDir + "/org/jboss/test/ws/jbws1725/PasswordType.java");
- }
-
- private static void compareSource(final String expectedName, final String generatedName) throws Exception
- {
- File expected = new File(expectedName);
- File generated = new File(generatedName);
-
- JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
- sc.validate();
- }
-}
Copied: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java)
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java 2007-07-19 12:22:59 UTC (rev 3949)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.tools.jbws1725;
+
+import java.io.File;
+
+import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+import org.jboss.wsf.spi.test.JBossWSTest;
+
+/**
+ * Test case for http://jira.jboss.com/jira/browse/JBWS-1725
+ *
+ * WSDL-JAVA Derivation of a complex type from a Simple type: bas64Binary
+ * is not mapped to byte[]
+ *
+ * @author mageshbk(a)jboss.com
+ * @since Jul 19, 2007
+ */
+public class JBWS1725TestCase extends JBossWSTest
+{
+
+ public void testExtensionType() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1725";
+ String toolsDir = "tools/jbws1725";
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ compareSource(resourceDir + "/PasswordType.java", toolsDir + "/org/jboss/test/ws/jbws1725/PasswordType.java");
+ }
+
+ private static void compareSource(final String expectedName, final String generatedName) throws Exception
+ {
+ File expected = new File(expectedName);
+ File generated = new File(generatedName);
+
+ JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
+ sc.validate();
+ }
+}
Copied: trunk/jbossws-core/src/test/resources/tools/jbws1725 (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725)
Deleted: trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl 2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl 2007-07-19 12:22:59 UTC (rev 3949)
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1725' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1725/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1725' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <types>
- <schema targetNamespace='http://test.jboss.org/ws/jbws1725/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1725/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
- <complexType name="PasswordType">
- <simpleContent>
- <extension base="xsd:base64Binary"/>
- </simpleContent>
- </complexType>
- <complexType name='Person'>
- <sequence>
- <element name='firstName' nillable='true' type='string'/>
- <element name='surname' nillable='true' type='string'/>
- <element name='password' type='tns:PasswordType'/>
- </sequence>
- </complexType>
- <complexType name='TelephoneNumber'>
- <sequence>
- <element name='Number'>
- <complexType>
- <sequence>
- <element name='areaCode' nillable='true' type='string'/>
- <element name='number' nillable='true' type='string'/>
- </sequence>
- </complexType>
- </element>
- </sequence>
- </complexType>
- <element name='lookup' type='tns:Person'/>
- <element name='lookupResponse' type='tns:TelephoneNumber'/>
- </schema>
- </types>
- <message name='PhoneBook_lookup'>
- <part element='ns1:lookup' name='parameters'/>
- </message>
- <message name='PhoneBook_lookupResponse'>
- <part element='ns1:lookupResponse' name='result'/>
- </message>
- <portType name='PhoneBook'>
- <operation name='lookup'>
- <input message='tns:PhoneBook_lookup'/>
- <output message='tns:PhoneBook_lookupResponse'/>
- </operation>
- </portType>
- <binding name='PhoneBookBinding' type='tns:PhoneBook'>
- <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
- <operation name='lookup'>
- <soap:operation soapAction=''/>
- <input>
- <soap:body use='literal'/>
- </input>
- <output>
- <soap:body use='literal'/>
- </output>
- </operation>
- </binding>
- <service name='PhoneBook'>
- <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
- <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
- </port>
- </service>
-</definitions>
\ No newline at end of file
Copied: trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl)
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl 2007-07-19 12:22:59 UTC (rev 3949)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1725' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1725/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1725' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1725/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1725/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <complexType name="PasswordType">
+ <simpleContent>
+ <extension base="xsd:base64Binary"/>
+ </simpleContent>
+ </complexType>
+ <complexType name='Person'>
+ <sequence>
+ <element name='firstName' nillable='true' type='string'/>
+ <element name='surname' nillable='true' type='string'/>
+ <element name='password' type='tns:PasswordType'/>
+ </sequence>
+ </complexType>
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ <element name='Number'>
+ <complexType>
+ <sequence>
+ <element name='areaCode' nillable='true' type='string'/>
+ <element name='number' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ <element name='lookup' type='tns:Person'/>
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Deleted: trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java 2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java 2007-07-19 12:22:59 UTC (rev 3949)
@@ -1,27 +0,0 @@
-/*
- * JBossWS WS-Tools Generated Source
- *
- * Generation Date: Mon Jul 16 18:47:44 IST 2007
- *
- * This generated source code represents a derivative work of the input to
- * the generator that produced it. Consult the input for the copyright and
- * terms of use that apply to this source code.
- */
-
-package org.jboss.test.ws.jbws1725;
-
-
-public class PasswordType
-{
-
-protected byte[] _value;
-public PasswordType(){}
-
-public PasswordType(byte[] _value){
-this._value=_value;
-}
-public byte[] get_value() { return _value ;}
-
-public void set_value(byte[] _value){ this._value=_value; }
-
-}
Copied: trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java)
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java 2007-07-19 12:22:59 UTC (rev 3949)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Mon Jul 16 18:47:44 IST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jbws1725;
+
+
+public class PasswordType
+{
+
+protected byte[] _value;
+public PasswordType(){}
+
+public PasswordType(byte[] _value){
+this._value=_value;
+}
+public byte[] get_value() { return _value ;}
+
+public void set_value(byte[] _value){ this._value=_value; }
+
+}
Deleted: trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml 2007-07-19 12:08:44 UTC (rev 3948)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml 2007-07-19 12:22:59 UTC (rev 3949)
@@ -1,9 +0,0 @@
-<configuration xmlns="http://www.jboss.org/jbossws-tools"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
-
- <wsdl-java location="resources/tools/jbws1725/Extension.wsdl" parameter-style="bare">
- <mapping file="extended-mapping.xml"/>
- </wsdl-java>
-
-</configuration>
\ No newline at end of file
Copied: trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml (from rev 3948, branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml)
===================================================================
--- trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml (rev 0)
+++ trunk/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml 2007-07-19 12:22:59 UTC (rev 3949)
@@ -0,0 +1,9 @@
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <wsdl-java location="resources/tools/jbws1725/Extension.wsdl" parameter-style="bare">
+ <mapping file="extended-mapping.xml"/>
+ </wsdl-java>
+
+</configuration>
\ No newline at end of file
17 years, 5 months
JBossWS SVN: r3948 - in branches/jbossws-2.0/jbossws-core/src/test: java/org/jboss/test/ws/tools/jbws1725 and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-07-19 08:08:44 -0400 (Thu, 19 Jul 2007)
New Revision: 3948
Added:
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/
branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/
branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
Log:
[JBWS-1725] Added Testcase that compares the generated file
Added: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java 2007-07-19 12:08:44 UTC (rev 3948)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.tools.jbws1725;
+
+import java.io.File;
+
+import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+import org.jboss.wsf.spi.test.JBossWSTest;
+
+/**
+ * Test case for http://jira.jboss.com/jira/browse/JBWS-1725
+ *
+ * WSDL-JAVA Derivation of a complex type from a Simple type: bas64Binary
+ * is not mapped to byte[]
+ *
+ * @author mageshbk(a)jboss.com
+ * @since Jul 19, 2007
+ */
+public class JBWS1725TestCase extends JBossWSTest
+{
+
+ public void testExtensionType() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1725";
+ String toolsDir = "tools/jbws1725";
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ compareSource(resourceDir + "/PasswordType.java", toolsDir + "/org/jboss/test/ws/jbws1725/PasswordType.java");
+ }
+
+ private static void compareSource(final String expectedName, final String generatedName) throws Exception
+ {
+ File expected = new File(expectedName);
+ File generated = new File(generatedName);
+
+ JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
+ sc.validate();
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-core/src/test/java/org/jboss/test/ws/tools/jbws1725/JBWS1725TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl 2007-07-19 12:08:44 UTC (rev 3948)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1725' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1725/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1725' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1725/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1725/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <complexType name="PasswordType">
+ <simpleContent>
+ <extension base="xsd:base64Binary"/>
+ </simpleContent>
+ </complexType>
+ <complexType name='Person'>
+ <sequence>
+ <element name='firstName' nillable='true' type='string'/>
+ <element name='surname' nillable='true' type='string'/>
+ <element name='password' type='tns:PasswordType'/>
+ </sequence>
+ </complexType>
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ <element name='Number'>
+ <complexType>
+ <sequence>
+ <element name='areaCode' nillable='true' type='string'/>
+ <element name='number' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ <element name='lookup' type='tns:Person'/>
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/Extension.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java 2007-07-19 12:08:44 UTC (rev 3948)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Mon Jul 16 18:47:44 IST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jbws1725;
+
+
+public class PasswordType
+{
+
+protected byte[] _value;
+public PasswordType(){}
+
+public PasswordType(byte[] _value){
+this._value=_value;
+}
+public byte[] get_value() { return _value ;}
+
+public void set_value(byte[] _value){ this._value=_value; }
+
+}
Property changes on: branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/PasswordType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml 2007-07-19 12:08:44 UTC (rev 3948)
@@ -0,0 +1,9 @@
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <wsdl-java location="resources/tools/jbws1725/Extension.wsdl" parameter-style="bare">
+ <mapping file="extended-mapping.xml"/>
+ </wsdl-java>
+
+</configuration>
\ No newline at end of file
Property changes on: branches/jbossws-2.0/jbossws-core/src/test/resources/tools/jbws1725/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 5 months
JBossWS SVN: r3947 - branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-07-19 07:58:52 -0400 (Thu, 19 Jul 2007)
New Revision: 3947
Modified:
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
Log:
[JBWS-1725]WSDL-JAVA Derivation of a complex type from a Simple type: bas64Binary is not mapped to byte[]
Modified: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2007-07-19 09:48:40 UTC (rev 3946)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2007-07-19 11:58:52 UTC (rev 3947)
@@ -56,6 +56,7 @@
/** Class that converts a XSD Type into Java class
* @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
+ * @author mageshbk(a)jboss.com
* @since Apr 4, 2005
*/
public class XSDTypeToJava
@@ -202,7 +203,17 @@
XSSimpleTypeDefinition xssimple = type.getSimpleType();
QName q = new QName(xssimple.getNamespace(), xssimple.getName());
QName qn = schemautils.patchXSDQName(q);
- VAR v = new VAR("_value", typeMapping.getJavaType(qn).getName(), false);
+ Class javaType = typeMapping.getJavaType(qn);
+ String jtype = null;
+ if (javaType.isArray())
+ {
+ jtype = JavaUtils.getSourceName(javaType);
+ }
+ else
+ {
+ jtype = javaType.getName();
+ }
+ VAR v = new VAR("_value", jtype, false);
vars.add(v);
}
}
17 years, 5 months
JBossWS SVN: r3946 - trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-19 05:48:40 -0400 (Thu, 19 Jul 2007)
New Revision: 3946
Modified:
trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java
Log:
javadoc
Modified: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java 2007-07-19 09:39:30 UTC (rev 3945)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ServiceLifecycleInvocationHandler.java 2007-07-19 09:48:40 UTC (rev 3946)
@@ -32,7 +32,9 @@
import org.jboss.wsf.spi.invocation.InvocationHandlerJSE;
/**
- * Handles invocations on JSE endpoints.
+ * Handles invocations on JSE endpoints that implement the standard
+ * javax.xml.rpc.server.ServiceLifecycle interface
+ *
*
* @author Thomas.Diesler(a)jboss.org
* @since 25-Apr-2007
17 years, 5 months
JBossWS SVN: r3945 - branches/jbossws-2.0/build.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-07-19 05:39:30 -0400 (Thu, 19 Jul 2007)
New Revision: 3945
Modified:
branches/jbossws-2.0/build/build.xml
Log:
Test commit lock
Modified: branches/jbossws-2.0/build/build.xml
===================================================================
--- branches/jbossws-2.0/build/build.xml 2007-07-19 08:52:36 UTC (rev 3944)
+++ branches/jbossws-2.0/build/build.xml 2007-07-19 09:39:30 UTC (rev 3945)
@@ -11,6 +11,7 @@
<!-- -->
<!-- ====================================================================== -->
+
<!--
The JBossWS project is organised like this
17 years, 5 months
JBossWS SVN: r3944 - trunk/integration/spi/src/main/java/org/jboss/ws/integration.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-07-19 04:52:36 -0400 (Thu, 19 Jul 2007)
New Revision: 3944
Modified:
trunk/integration/spi/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java
Log:
Fix ServiceRefHandler
Modified: trunk/integration/spi/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java 2007-07-18 21:24:35 UTC (rev 3943)
+++ trunk/integration/spi/src/main/java/org/jboss/ws/integration/ServiceRefHandler.java 2007-07-19 08:52:36 UTC (rev 3944)
@@ -27,7 +27,6 @@
import javax.naming.NamingException;
import org.jboss.xb.binding.UnmarshallingContext;
-import org.jboss.wsf.spi.deployment.serviceref.ServiceRefBinder;
import org.xml.sax.Attributes;
/**
@@ -47,8 +46,4 @@
void setValue(ServiceRefElement ref, UnmarshallingContext navigator, String namespaceURI, String localName, String value);
void bindServiceRef(Context encCtx, String encName, UnifiedVirtualFile vfsRoot, ClassLoader loader, ServiceRefMetaData sref) throws NamingException;
-
- void setJaxrpcBinder(ServiceRefBinder binder);
-
- void setJaxwsBinder(ServiceRefBinder binder);
}
17 years, 5 months
JBossWS SVN: r3943 - branches/asoldano/integration/spi/src/main/java/org/jboss/wsf/spi/invocation.
by jbossws-commits@lists.jboss.org
Author: palin
Date: 2007-07-18 17:24:35 -0400 (Wed, 18 Jul 2007)
New Revision: 3943
Modified:
branches/asoldano/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicInvocationHandler.java
Log:
Modified: branches/asoldano/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicInvocationHandler.java
===================================================================
--- branches/asoldano/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicInvocationHandler.java 2007-07-18 19:30:23 UTC (rev 3942)
+++ branches/asoldano/integration/spi/src/main/java/org/jboss/wsf/spi/invocation/BasicInvocationHandler.java 2007-07-18 21:24:35 UTC (rev 3943)
@@ -92,30 +92,6 @@
protected final void handleInvocationException(Throwable th) throws Exception
{
-// if (th instanceof MBeanException)
-// {
-// throw ((MBeanException)th).getTargetException();
-// }
-//
-// if (th instanceof InvocationTargetException)
-// {
-// // Unwrap the throwable raised by the service endpoint implementation
-// Throwable targetEx = ((InvocationTargetException)th).getTargetException();
-// handleInvocationException(targetEx);
-// }
-//
-// if (th instanceof Exception)
-// {
-// throw (Exception)th;
-// }
-//
-// if (th instanceof Error)
-// {
-// throw (Error)th;
-// }
-//
-// throw new UndeclaredThrowableException(th);
-
//delegate exception handling to the configured handler
exceptionHandler.handleInvocationException(th);
}
17 years, 5 months