[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jboss-cvs-commits
Subject:    [jboss-cvs] contrib/jboss.net/src/main/org/jboss/net/ws4ee/server EJBInvokerProvider.java EJBProxyFa
From:       thomas diesler <tdiesler () users ! sourceforge ! net>
Date:       2003-10-31 23:38:16
[Download RAW message or body]

  User: tdiesler
  Date: 03/10/31 15:38:16

  Modified:    jboss.net/src/main/org/jboss/net/ws4ee/server
                        EJBInvokerProvider.java EJBProxyFactoryImpl.java
                        JBossNetBaseProvider.java
                        JBossNetWebAppProvider.java WS4EEDeployer.java
                        WebServiceModule.java
  Log:
  layout code using style from jboss-server
  
  Revision  Changes    Path
  1.2       +93 -72    \
contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/EJBInvokerProvider.java  
  Index: EJBInvokerProvider.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/EJBInvokerProvider.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EJBInvokerProvider.java	31 Oct 2003 18:23:47 -0000	1.1
  +++ EJBInvokerProvider.java	31 Oct 2003 23:38:16 -0000	1.2
  @@ -5,26 +5,24 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: EJBInvokerProvider.java,v 1.1 2003/10/31 18:23:47 cgjung Exp $
  +// $Id: EJBInvokerProvider.java,v 1.2 2003/10/31 23:38:16 tdiesler Exp $
   
   package org.jboss.net.ws4ee.server;
   
  -import java.lang.reflect.Method;
  -
  -import javax.ejb.EJBLocalObject;
  -import javax.ejb.EJBObject;
  -import javax.servlet.http.HttpSessionBindingEvent;
  -import javax.servlet.http.HttpSessionBindingListener;
  -import javax.xml.rpc.server.ServiceLifecycle;
  -
   import org.apache.axis.MessageContext;
  -
   import org.jboss.ejb.StatefulSessionContainer;
   import org.jboss.invocation.Invocation;
   import org.jboss.invocation.InvocationKey;
   import org.jboss.invocation.InvocationType;
   import org.jboss.invocation.PayloadKey;
   
  +import javax.ejb.EJBLocalObject;
  +import javax.ejb.EJBObject;
  +import javax.servlet.http.HttpSessionBindingEvent;
  +import javax.servlet.http.HttpSessionBindingListener;
  +import javax.xml.rpc.server.ServiceLifecycle;
  +import java.lang.reflect.Method;
  +
   /**
    * <p>
    * An axis rpc provider whose immediate target is the jboss container
  @@ -37,36 +35,46 @@
    * ws method, such as init
    * @since 29.10.2003
    * @author <a href="mailto:Christoph.Jung@infor.de">Christoph G. Jung</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   
  -public class EJBInvokerProvider extends JBossNetBaseProvider {
  +public class EJBInvokerProvider extends JBossNetBaseProvider
  +{
   
      /** the name of the invoker binding */
  -   public static String WEB_SERVICE_INVOKER_BINDING="session-webservice-invoker";
  -   
  +   public static String WEB_SERVICE_INVOKER_BINDING = \
"session-webservice-invoker";  +
      /** if we are running against a local bean */
      protected boolean runAgainstLocal = false;
   
  -   protected boolean isStateful() {
  +   protected boolean isStateful()
  +   {
         return pc.getServiceImplBean().getContainer()
  -         instanceof StatefulSessionContainer;
  +              instanceof StatefulSessionContainer;
      }
   
  -   protected Method getCreateMethod() throws NoSuchMethodException {
  +   protected Method getCreateMethod() throws NoSuchMethodException
  +   {
         Class home = pc.getServiceImplBean().getContainer().getLocalHomeClass();
  -      if (home == null) {
  +      if (home == null)
  +      {
            home = pc.getServiceImplBean().getContainer().getHomeClass();
  -      } else {
  +      }
  +      else
  +      {
            runAgainstLocal = true;
         }
         return home.getMethod("create", new Class[0]);
      }
   
  -   protected Method getRemoveMethod() throws NoSuchMethodException {
  -      if (runAgainstLocal) {
  +   protected Method getRemoveMethod() throws NoSuchMethodException
  +   {
  +      if (runAgainstLocal)
  +      {
            return EJBLocalObject.class.getMethod("remove", new Class[0]);
  -      } else {
  +      }
  +      else
  +      {
            return EJBObject.class.getMethod("remove", new Class[0]);
         }
      }
  @@ -75,21 +83,23 @@
       * @see org.apache.axis.providers.java.JavaProvider#makeNewServiceObject(org.apache.axis.MessageContext, \
                java.lang.String)
       */
      protected Object makeNewServiceObject(MessageContext arg0, String arg1)
  -      throws Exception {
  +           throws Exception
  +   {
         Object cacheKey = null;
  -      if (isStateful()) {
  +      if (isStateful())
  +      {
            Invocation inv =
  -            new Invocation(null, getCreateMethod(), new Object[0], null,
  -         /* tx */
  -         null, /* identity */
  -         null /* credential*/
  -         );
  +                 new Invocation(null, getCreateMethod(), new Object[0], null,
  +                         /* tx */
  +                         null, /* identity */
  +                         null /* credential*/
  +                 );
            inv.setValue(
  -            InvocationKey.INVOKER_PROXY_BINDING,
  -            WEB_SERVICE_INVOKER_BINDING,
  -            PayloadKey.AS_IS);
  +                 InvocationKey.INVOKER_PROXY_BINDING,
  +                 WEB_SERVICE_INVOKER_BINDING,
  +                 PayloadKey.AS_IS);
            inv.setType(
  -            runAgainstLocal ? InvocationType.LOCALHOME : InvocationType.HOME);
  +                 runAgainstLocal ? InvocationType.LOCALHOME : \
InvocationType.HOME);  cacheKey = pc.getServiceImplBean().getContainer().invoke(inv);
         }
         return new EJBServiceLifeCycle(cacheKey);
  @@ -99,21 +109,22 @@
       * @see org.apache.axis.providers.java.RPCProvider#invokeMethod(org.apache.axis.MessageContext, \
                java.lang.reflect.Method, java.lang.Object, java.lang.Object[])
       */
      protected Object invokeMethod(
  -      MessageContext arg0,
  -      Method arg1,
  -      Object arg2,
  -      Object[] arg3)
  -      throws Exception {
  +           MessageContext arg0,
  +           Method arg1,
  +           Object arg2,
  +           Object[] arg3)
  +           throws Exception
  +   {
         Invocation inv =
  -         new Invocation(
  -            ((EJBServiceLifeCycle) arg2).cacheKey,
  -            arg1,
  -            arg3,
  -            null,
  -      /* tx */
  -      null, /* identity */
  -      null /* credential*/
  -      );
  +              new Invocation(
  +                      ((EJBServiceLifeCycle) arg2).cacheKey,
  +                      arg1,
  +                      arg3,
  +                      null,
  +                      /* tx */
  +                      null, /* identity */
  +                      null /* credential*/
  +              );
         inv.setValue(InvocationKey.INVOKER_PROXY_BINDING, \
WEB_SERVICE_INVOKER_BINDING, PayloadKey.AS_IS);  \
inv.setType(InvocationType.SERVICE_ENDPOINT);  return \
pc.getServiceImplBean().getContainer().invoke(inv);  @@ -124,12 +135,13 @@
      //
   
      /**
  -    * This is the lifecycle object that is registered in the 
  +    * This is the lifecycle object that is registered in the
       * message scope and that shields the proper bean reference
       */
   
      protected class EJBServiceLifeCycle
  -      implements ServiceLifecycle, HttpSessionBindingListener {
  +           implements ServiceLifecycle, HttpSessionBindingListener
  +   {
   
         //
         // Attributes
  @@ -143,7 +155,8 @@
         //
   
         /** constructs a new lifecycle */
  -      protected EJBServiceLifeCycle(Object serviceObject) {
  +      protected EJBServiceLifeCycle(Object serviceObject)
  +      {
            this.cacheKey = serviceObject;
         }
   
  @@ -152,32 +165,37 @@
         //
   
         /**
  -       * call remove 
  +       * call remove
          * @see javax.xml.rpc.server.ServiceLifecycle#destroy()
          */
  -      public void destroy() {
  -         if (cacheKey != null) {
  -            try {
  +      public void destroy()
  +      {
  +         if (cacheKey != null)
  +         {
  +            try
  +            {
                  Invocation inv =
  -                  new Invocation(
  -                     cacheKey,
  -                     getRemoveMethod(),
  -                     new Object[0],
  -                     null,
  -               /* tx */
  -               null, /* identity */
  -               null /* credential*/
  -               );
  +                       new Invocation(
  +                               cacheKey,
  +                               getRemoveMethod(),
  +                               new Object[0],
  +                               null,
  +                               /* tx */
  +                               null, /* identity */
  +                               null /* credential*/
  +                       );
                  inv.setValue(
  -                  InvocationKey.INVOKER_PROXY_BINDING,
  -                  WEB_SERVICE_INVOKER_BINDING,
  -                  PayloadKey.AS_IS);
  +                       InvocationKey.INVOKER_PROXY_BINDING,
  +                       WEB_SERVICE_INVOKER_BINDING,
  +                       PayloadKey.AS_IS);
                  inv.setType(
  -                  runAgainstLocal
  -                     ? InvocationType.LOCALHOME
  -                     : InvocationType.HOME);
  +                       runAgainstLocal
  +                       ? InvocationType.LOCALHOME
  +                       : InvocationType.HOME);
                  pc.getServiceImplBean().getContainer().invoke(inv);
  -            } catch (Exception e) {
  +            }
  +            catch (Exception e)
  +            {
                  // TODO log that error somewhere
               }
               cacheKey = null;
  @@ -188,20 +206,23 @@
          * Nothing to be done
          * @see javax.xml.rpc.server.ServiceLifecycle#init(Object)
          */
  -      public void init(Object arg0) {
  +      public void init(Object arg0)
  +      {
         }
   
         /**
          * @see javax.servlet.http.HttpSessionBindingListener#valueBound(HttpSessionBindingEvent)
                
          */
  -      public void valueBound(HttpSessionBindingEvent arg0) {
  +      public void valueBound(HttpSessionBindingEvent arg0)
  +      {
            init(arg0);
         }
   
         /**
          * @see javax.servlet.http.HttpSessionBindingListener#valueUnbound(HttpSessionBindingEvent)
                
          */
  -      public void valueUnbound(HttpSessionBindingEvent arg0) {
  +      public void valueUnbound(HttpSessionBindingEvent arg0)
  +      {
            destroy();
         }
   
  
  
  
  1.2       +109 -96   \
contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/EJBProxyFactoryImpl.java  
  Index: EJBProxyFactoryImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/EJBProxyFactoryImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EJBProxyFactoryImpl.java	31 Oct 2003 18:23:47 -0000	1.1
  +++ EJBProxyFactoryImpl.java	31 Oct 2003 23:38:16 -0000	1.2
  @@ -5,20 +5,19 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: EJBProxyFactoryImpl.java,v 1.1 2003/10/31 18:23:47 cgjung Exp $
  +// $Id: EJBProxyFactoryImpl.java,v 1.2 2003/10/31 23:38:16 tdiesler Exp $
   
   package org.jboss.net.ws4ee.server;
   
  -import java.util.Collection;
  -
  -import javax.ejb.EJBMetaData;
  -import javax.management.ObjectName;
  -
   import org.jboss.ejb.Container;
   import org.jboss.ejb.EJBProxyFactory;
   import org.jboss.ejb.SessionContainer;
   import org.jboss.metadata.InvokerProxyBindingMetaData;
   
  +import javax.ejb.EJBMetaData;
  +import javax.management.ObjectName;
  +import java.util.Collection;
  +
   
   /**
    * <p>
  @@ -28,108 +27,120 @@
    * Since JAXRPC does not support most of the referential RMI stuff, this
    * is as easy as delivering the ultimate container hook to the web service
    * meta-data.
  - * </p> 
  + * </p>
    * @since 29.10.2003
    * @author jung
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    * @jmx.mbean extends="org.jboss.system.ServiceMBean"
    */
   
  -public class EJBProxyFactoryImpl implements EJBProxyFactory {
  +public class EJBProxyFactoryImpl implements EJBProxyFactory
  +{
  +
  +   protected Container container;
  +   protected String jndiName;
  +   protected String jnpName;
  +   protected InvokerProxyBindingMetaData metaData;
   
  -	protected Container container;
  -	protected String jndiName;
  -	protected String jnpName;
  -	protected InvokerProxyBindingMetaData metaData;
  -	
  -	/* (non-Javadoc)
  -	 * @see org.jboss.ejb.EJBProxyFactory#getEJBHome()
  -	 */
  -	public Object getEJBHome() {
  -		throw new Error("Not necessary for service endpoints");	
  -	}
  -
  -	/* (non-Javadoc)
  -	 * @see org.jboss.ejb.EJBProxyFactory#getEJBMetaData()
  -	 */
  -	public EJBMetaData getEJBMetaData() {
  -		throw new Error("Not necessary for service endpoints");	
  -	}
  -
  -	/* (non-Javadoc)
  -	 * @see org.jboss.ejb.EJBProxyFactory#getEntityCollection(java.util.Collection)
  -	 */
  -	public Collection getEntityCollection(Collection enum) {
  -		throw new Error("Not valid for service endpoints");	
  -	}
  -
  -	/* (non-Javadoc)
  -	 * @see org.jboss.ejb.EJBProxyFactory#getEntityEJBObject(java.lang.Object)
  -	 */
  -	public Object getEntityEJBObject(Object id) {
  -		throw new Error("Not valid for service endpoints");	
  -	}
  -
  -	/* (non-Javadoc)
  -    * we keep the id as is for being cached in the 
  -    * web service session 
  -	 * @see org.jboss.ejb.EJBProxyFactory#getStatefulSessionEJBObject(java.lang.Object)
                
  -	 */
  -	public Object getStatefulSessionEJBObject(Object id) {
  -		return id;
  -	}
  -
  -	/* (non-Javadoc)
  -	 * @see org.jboss.ejb.EJBProxyFactory#getStatelessSessionEJBObject()
  -	 */
  -	public Object getStatelessSessionEJBObject() {
  +   /* (non-Javadoc)
  +    * @see org.jboss.ejb.EJBProxyFactory#getEJBHome()
  +    */
  +   public Object getEJBHome()
  +   {
         throw new Error("Not necessary for service endpoints");
  -	}
  +   }
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.ejb.EJBProxyFactory#getEJBMetaData()
  +    */
  +   public EJBMetaData getEJBMetaData()
  +   {
  +      throw new Error("Not necessary for service endpoints");
  +   }
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.ejb.EJBProxyFactory#getEntityCollection(java.util.Collection)
  +    */
  +   public Collection getEntityCollection(Collection enum)
  +   {
  +      throw new Error("Not valid for service endpoints");
  +   }
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.ejb.EJBProxyFactory#getEntityEJBObject(java.lang.Object)
  +    */
  +   public Object getEntityEJBObject(Object id)
  +   {
  +      throw new Error("Not valid for service endpoints");
  +   }
   
  -	/* (non-Javadoc)
  -	 * @see org.jboss.ejb.EJBProxyFactory#setInvokerBinding(java.lang.String)
  -	 */
  -	public void setInvokerBinding(String binding) {
  -		jndiName=binding;
  -	}
  -
  -	/* (non-Javadoc)
  -	 * @see org.jboss.ejb.EJBProxyFactory#setInvokerMetaData(org.jboss.metadata.InvokerProxyBindingMetaData)
                
  -	 */
  -	public void setInvokerMetaData(InvokerProxyBindingMetaData imd) {
  -		metaData=imd;
  -	}
  -
  -	/* (non-Javadoc)
  -	 * @see org.jboss.ejb.ContainerPlugin#setContainer(org.jboss.ejb.Container)
  -	 */
  -	public void setContainer(Container con) {
  -		container = con;
  -	}
  -
  -
  -	/* (non-Javadoc)
  -	 * @see org.jboss.system.ServiceMeanSupport#createService()
  -	 */
  -	public void create() throws Exception {
  -		Class serviceInterface=((SessionContainer) container).
  -         getServiceEndpoint();
  -
  -      // how would the corresponding webservice module be named?
  -      ObjectName webServiceModule=WebServiceModule.
  -         convertDeploymentInfoToModuleObjectName(container.
  -            getDeploymentInfo());
  -         
  -      // register server jmx name
  +   /* (non-Javadoc)
  +* we keep the id as is for being cached in the
  +* web service session
  +    * @see org.jboss.ejb.EJBProxyFactory#getStatefulSessionEJBObject(java.lang.Object)
  +    */
  +   public Object getStatefulSessionEJBObject(Object id)
  +   {
  +      return id;
  +   }
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.ejb.EJBProxyFactory#getStatelessSessionEJBObject()
  +    */
  +   public Object getStatelessSessionEJBObject()
  +   {
  +      throw new Error("Not necessary for service endpoints");
  +   }
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.ejb.EJBProxyFactory#setInvokerBinding(java.lang.String)
  +    */
  +   public void setInvokerBinding(String binding)
  +   {
  +      jndiName = binding;
  +   }
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.ejb.EJBProxyFactory#setInvokerMetaData(org.jboss.metadata.InvokerProxyBindingMetaData)
  +    */
  +   public void setInvokerMetaData(InvokerProxyBindingMetaData imd)
  +   {
  +      metaData = imd;
  +   }
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.ejb.ContainerPlugin#setContainer(org.jboss.ejb.Container)
  +    */
  +   public void setContainer(Container con)
  +   {
  +      container = con;
  +   }
  +
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.system.ServiceMeanSupport#createService()
  +    */
  +   public void create() throws Exception
  +   {
  +      Class serviceInterface = ((SessionContainer) container).
  +              getServiceEndpoint();
  +
  +// how would the corresponding webservice module be named?
  +      ObjectName webServiceModule = WebServiceModule.
  +              convertDeploymentInfoToModuleObjectName(container.
  +              getDeploymentInfo());
  +
  +// register server jmx name
         container.getServer().invoke(webServiceModule,
  -         "registerEJBContainer",new Object[] {container}, 
  -         new String[] {SessionContainer.class.getName()});			
  -	}
  +              "registerEJBContainer", new Object[]{container},
  +              new String[]{SessionContainer.class.getName()});
  +   }
   
      /* (non-Javadoc)
       * @see org.jboss.system.Service#destroy()
       */
  -   public void destroy() {
  +   public void destroy()
  +   {
         // TODO Auto-generated method stub
   
      }
  @@ -137,7 +148,8 @@
      /* (non-Javadoc)
       * @see org.jboss.system.Service#start()
       */
  -   public void start() throws Exception {
  +   public void start() throws Exception
  +   {
         // TODO Auto-generated method stub
   
      }
  @@ -145,7 +157,8 @@
      /* (non-Javadoc)
       * @see org.jboss.system.Service#stop()
       */
  -   public void stop() {
  +   public void stop()
  +   {
         // TODO Auto-generated method stub
   
      }
  
  
  
  1.3       +43 -30    \
contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/JBossNetBaseProvider.java  
  Index: JBossNetBaseProvider.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/JBossNetBaseProvider.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JBossNetBaseProvider.java	31 Oct 2003 18:23:47 -0000	1.2
  +++ JBossNetBaseProvider.java	31 Oct 2003 23:38:16 -0000	1.3
  @@ -5,16 +5,14 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: JBossNetBaseProvider.java,v 1.2 2003/10/31 18:23:47 cgjung Exp $
  +// $Id: JBossNetBaseProvider.java,v 1.3 2003/10/31 23:38:16 tdiesler Exp $
   
   package org.jboss.net.ws4ee.server;
   
   import org.apache.axis.AxisFault;
   import org.apache.axis.MessageContext;
  -
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.providers.java.RPCProvider;
  -
   import org.jboss.mx.util.MBeanServerLocator;
   import org.jboss.mx.util.ObjectNameConverter;
   import org.jboss.net.ws4ee.metadata.PortComponent;
  @@ -29,16 +27,17 @@
   
   /**
    * <p>
  - * An RPC provider base that provides access to some 
  + * An RPC provider base that provides access to some
    * webservice specific meta-data artifacts through JMX.
    * </p>
    * @since 25. October 2003
    * @author <a href="mailto:thomas.diesler@arcor.de">Thomas Diesler</a>
    * @author <a href="mailto:christoph.jung@infor.de">Christoph Jung</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   
  -public class JBossNetBaseProvider extends RPCProvider {
  +public class JBossNetBaseProvider extends RPCProvider
  +{
      /** gets a reference to its meta-data */
      protected PortComponent pc;
      /** the mbean server we are attached to */
  @@ -49,37 +48,47 @@
       * @see org.apache.axis.providers.BasicProvider#initServiceDesc(org.apache.axis.handlers.soap.SOAPService, \
                org.apache.axis.MessageContext)
       */
      public void initServiceDesc(SOAPService service, MessageContext msgContext)
  -      throws AxisFault {
  +           throws AxisFault
  +   {
         server = MBeanServerLocator.locateJBoss();
         // build objectname and position from service parameters
  -      try {
  +      try
  +      {
            ObjectName webServiceModuleName =
  -            ObjectNameConverter.convert(
  -               (String) service.getOption(
  -                  PortComponent.PARAMETER_WEB_SERVICE_MODULE));
  +                 ObjectNameConverter.convert(
  +                         (String) service.getOption(
  +                                 PortComponent.PARAMETER_WEB_SERVICE_MODULE));
            Integer webServicePos =
  -            new Integer(
  -               (String) service.getOption(
  -                  PortComponent.PARAMETER_WEB_SERVICE_POS));
  +                 new Integer(
  +                         (String) service.getOption(
  +                                 PortComponent.PARAMETER_WEB_SERVICE_POS));
            WebserviceDescription desc =
  -            (WebserviceDescription) server.invoke(
  -               webServiceModuleName,
  -               "getWebServiceDescription",
  -               new Object[] { webServicePos },
  -               new String[] { int.class.getName()});
  +                 (WebserviceDescription) server.invoke(
  +                         webServiceModuleName,
  +                         "getWebServiceDescription",
  +                         new Object[]{webServicePos},
  +                         new String[]{int.class.getName()});
            int portComponentPos =
  -            new Integer(
  -               (String) service.getOption(
  -                  PortComponent.PARAMETER_PORT_COMPONENT_POS))
  -               .intValue();
  +                 new Integer(
  +                         (String) service.getOption(
  +                                 PortComponent.PARAMETER_PORT_COMPONENT_POS))
  +                 .intValue();
            pc = desc.getPortComponent(portComponentPos);
  -      } catch (MalformedObjectNameException e) {
  +      }
  +      catch (MalformedObjectNameException e)
  +      {
            throw new AxisFault(e.toString());
  -      } catch (InstanceNotFoundException e) {
  +      }
  +      catch (InstanceNotFoundException e)
  +      {
            throw new AxisFault(e.toString());
  -      } catch (MBeanException e) {
  +      }
  +      catch (MBeanException e)
  +      {
            throw new AxisFault(e.toString());
  -      } catch (ReflectionException e) {
  +      }
  +      catch (ReflectionException e)
  +      {
            throw new AxisFault(e.toString());
         }
         // delegate to parent
  @@ -91,10 +100,14 @@
       * deployment meta-data.
       * @see org.apache.axis.Handler#generateWSDL(org.apache.axis.MessageContext)
       */
  -   public void generateWSDL(MessageContext msgContext) throws AxisFault {
  -      try {
  +   public void generateWSDL(MessageContext msgContext) throws AxisFault
  +   {
  +      try
  +      {
            pc.getDescription().generateWsdl(msgContext);
  -      } catch (Exception e) {
  +      }
  +      catch (Exception e)
  +      {
            throw new AxisFault(e.toString());
         }
      }
  
  
  
  1.2       +4 -4      \
contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/JBossNetWebAppProvider.java  
  Index: JBossNetWebAppProvider.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/JBossNetWebAppProvider.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JBossNetWebAppProvider.java	29 Oct 2003 10:48:05 -0000	1.1
  +++ JBossNetWebAppProvider.java	31 Oct 2003 23:38:16 -0000	1.2
  @@ -5,7 +5,7 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: JBossNetWebAppProvider.java,v 1.1 2003/10/29 10:48:05 cgjung Exp $
  +// $Id: JBossNetWebAppProvider.java,v 1.2 2003/10/31 23:38:16 tdiesler Exp $
   
   package org.jboss.net.ws4ee.server;
   
  @@ -17,7 +17,7 @@
    *
    * @since 25. October 2003
    * @author <a href="mailto:thomas.diesler@arcor.de">Thomas Diesler</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class JBossNetWebAppProvider extends JBossNetBaseProvider
   {
  @@ -31,8 +31,8 @@
         // get the ejb-link from webservices.xml
         String servletLink = (String) \
msgContext.getService().getOption(ServiceImplBean.OPTION_SERVLET_LINK);  
  -	  Class clazz =msgContext.getClassLoader().loadClass(servletLink);
  -	  
  +      Class clazz = msgContext.getClassLoader().loadClass(servletLink);
  +
         Object servletObj = clazz.newInstance();
   
         // TODO (tdi) think about livecycle, context-param, init-param
  
  
  
  1.3       +184 -182  \
contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/WS4EEDeployer.java  
  Index: WS4EEDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/WS4EEDeployer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WS4EEDeployer.java	31 Oct 2003 18:23:47 -0000	1.2
  +++ WS4EEDeployer.java	31 Oct 2003 23:38:16 -0000	1.3
  @@ -5,7 +5,7 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: WS4EEDeployer.java,v 1.2 2003/10/31 18:23:47 cgjung Exp $
  +// $Id: WS4EEDeployer.java,v 1.3 2003/10/31 23:38:16 tdiesler Exp $
   
   package org.jboss.net.ws4ee.server;
   
  @@ -14,7 +14,6 @@
   import org.jboss.deployment.SubDeployerSupport;
   import org.jboss.mx.util.MBeanProxyExt;
   import org.jboss.net.server.JBossNetEntityResolver;
  -
   import org.jboss.system.ServiceControllerMBean;
   
   import javax.management.MBeanRegistration;
  @@ -34,7 +33,8 @@
    * @since 25. October 2003
    * @author <a href="mailto:thomas.diesler@arcor.de">Thomas Diesler</a>
    * @author <a href="mailto:christoph.jung@infor.de">Christoph G. Jung</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
  + *
    * @jmx.mbean
    * 	name="jboss.net:service=WS4EEDeployer"
    * 	description="WS4EE web service deployer"
  @@ -42,192 +42,194 @@
    */
   
   public class WS4EEDeployer
  -	extends SubDeployerSupport
  -	implements WS4EEDeployerMBean, MBeanRegistration {
  -
  -	//
  -	// Attributes
  -	//
  -
  -	/** link to the axis deployer */
  -	protected ObjectName axisDeployer;
  -	/** document builder for xml parsing */
  -	protected DocumentBuilder documentBuilder;
  -	/** whether we are validating */
  -	protected boolean validateDTDs;
  -	/** verify deployments */
  -	protected boolean verify;
  -	/** service controller mbean */
  +        extends SubDeployerSupport
  +        implements WS4EEDeployerMBean, MBeanRegistration
  +{
  +
  +   //
  +   // Attributes
  +   //
  +
  +   /** link to the axis deployer */
  +   protected ObjectName axisDeployer;
  +   /** document builder for xml parsing */
  +   protected DocumentBuilder documentBuilder;
  +   /** whether we are validating */
  +   protected boolean validateDTDs;
  +   /** verify deployments */
  +   protected boolean verify;
  +   /** service controller mbean */
      protected ServiceControllerMBean serviceController;
  -   
  -	/* (non-Javadoc)
  -	 * @see org.jboss.system.ServiceMBeanSupport#startService()
  -	 */
  -	protected void startService() throws Exception {
  -		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  -		dbf.setNamespaceAware(true);
  -		dbf.setValidating(validateDTDs);
  -		// this will (along JAXP in conjunction with 
  -		// validation+namespace-awareness) enable xml schema checking. 
  -		// Will currently fail because some J2EE1.4/W3C schemas 
  -		// are still lacking.
  -		//dbf.setAttribute
  -		//   ("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema");
                
  -		documentBuilder = dbf.newDocumentBuilder();
  -		documentBuilder.setEntityResolver(new JBossNetEntityResolver());
  -      serviceController = (ServiceControllerMBean)
  -         MBeanProxyExt.create(ServiceControllerMBean.class,
  -                              ServiceControllerMBean.OBJECT_NAME, server);
  -		super.startService();
  -	}
  -
  -	/* (non-Javadoc)
  -	 * @see org.jboss.system.ServiceMBeanSupport#stopService()
  -	 */
  -	protected void stopService() throws Exception {
  -		super.stopService();
  -		documentBuilder = null;
  -	}
  -
  -	//----------------------------------------------------------------------------
  -	// Service interface
  -	//----------------------------------------------------------------------------
  -
  -	/**
  -	 * @return
  -	 * @jmx.managed-operation
  -	 */
  -	public ObjectName getAxisDeployer() {
  -		return axisDeployer;
  -	}
  -
  -	/**
  -	 * @param axisDeployer
  -	 * @jmx.managed-operation
  -	 */
  -	public void setAxisDeployer(ObjectName axisDeployer) {
  -		this.axisDeployer = axisDeployer;
  -	}
  -
  -	//----------------------------------------------------------------------------
  -	// SubDeployer interface
  -	//----------------------------------------------------------------------------
   
  -	/* (non-javadoc)
  -    * we currently only accept document-based subdeployments
  +   /* (non-Javadoc)
  +    * @see org.jboss.system.ServiceMBeanSupport#startService()
  +    */
  +   protected void startService() throws Exception
  +   {
  +      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  +      dbf.setNamespaceAware(true);
  +      dbf.setValidating(validateDTDs);
  +      // this will (along JAXP in conjunction with
  +      // validation+namespace-awareness) enable xml schema checking.
  +      // Will currently fail because some J2EE1.4/W3C schemas
  +      // are still lacking.
  +      //dbf.setAttribute
  +      //   ("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema");
  +      documentBuilder = dbf.newDocumentBuilder();
  +      documentBuilder.setEntityResolver(new JBossNetEntityResolver());
  +      serviceController = (ServiceControllerMBean) \
MBeanProxyExt.create(ServiceControllerMBean.class,  +                                 \
ServiceControllerMBean.OBJECT_NAME, server);  +      super.startService();
  +   }
  +
  +   /* (non-Javadoc)
  +    * @see org.jboss.system.ServiceMBeanSupport#stopService()
  +    */
  +   protected void stopService() throws Exception
  +   {
  +      super.stopService();
  +      documentBuilder = null;
  +   }
  +
  +   //----------------------------------------------------------------------------
  +   // Service interface
  +   //----------------------------------------------------------------------------
  +
  +   /**
  +    * @return
  +    * @jmx.managed-operation
       */
  +   public ObjectName getAxisDeployer()
  +   {
  +      return axisDeployer;
  +   }
  +
  +   /**
  +    * @param axisDeployer
  +    * @jmx.managed-operation
  +    */
  +   public void setAxisDeployer(ObjectName axisDeployer)
  +   {
  +      this.axisDeployer = axisDeployer;
  +   }
  +
  +   //----------------------------------------------------------------------------
  +   // SubDeployer interface
  +   //----------------------------------------------------------------------------
   
  -	public boolean accepts(DeploymentInfo sdi) {
  -      if(sdi.url.getFile().endsWith("META-INF/webservices.xml")) {
  +   /* (non-javadoc)
  +    * we currently only accept document-based subdeployments
  +    */
  +   public boolean accepts(DeploymentInfo sdi)
  +   {
  +      if (sdi.url.getFile().endsWith("META-INF/webservices.xml"))
  +      {
            return true;
         }
  -		return false;
  -	}
  +      return false;
  +   }
   
  -	/* (non-javadoc)
  -    * this assumes that we will be delegated a pure document deployment
  -	 */
  -	public void init(DeploymentInfo sdi) throws DeploymentException {
  -		try {
  -			sdi.documentUrl = sdi.url;
  -         WebServiceModule module=new WebServiceModule(sdi,documentBuilder);
  -         sdi.metaData=module;
  -         getServer().registerMBean(module,module.getObjectName());
  +   /* (non-javadoc)
  +   * this assumes that we will be delegated a pure document deployment
  +   */
  +   public void init(DeploymentInfo sdi) throws DeploymentException
  +   {
  +      try
  +      {
  +         sdi.documentUrl = sdi.url;
  +         WebServiceModule module = new WebServiceModule(sdi, documentBuilder);
  +         sdi.metaData = module;
  +         getServer().registerMBean(module, module.getObjectName());
            // in order to deploy to Axis
  -         getServer().invoke(
  -            axisDeployer,
  -            "init",
  -            new Object[] { sdi },
  -            new String[] { DeploymentInfo.class.getName()});          
  -		} catch (Exception e) {
  -			throw new DeploymentException(e);
  -		}
  -	}
  -
  -	/**
  -	 * Set up the components of the deployment that do not
  -	 * refer to other components
  -	 *
  -	 * @param sdi a <code>DeploymentInfo</code> value
  -	 * @throws DeploymentException      Failed to deploy
  -	 */
  -	public void create(DeploymentInfo sdi) throws DeploymentException {
  -		// in order to deploy to Axis
  -		try {
  -         WebServiceModule module=(WebServiceModule) sdi.metaData;
  -         serviceController.create(module.getObjectName(),module.getDependencies());
                
  -			getServer().invoke(
  -				axisDeployer,
  -				"create",
  -				new Object[] { sdi },
  -				new String[] { DeploymentInfo.class.getName()});
  -		} catch (Exception e) {
  -			throw new DeploymentException(e);
  -		} 
  -	}
  -
  -	/**
  -	 * The <code>start</code> method sets up relationships with other components.
  -	 *
  -	 * At this point the EJB or Web App should already heve been created
  -	 *
  -	 * @param sdi a <code>DeploymentInfo</code> value
  -	 * @throws DeploymentException if an error occurs
  -	 */
  -	public void start(DeploymentInfo sdi) throws DeploymentException {
  -		try {
  -         serviceController.start(((WebServiceModule) sdi.metaData).
  -            getObjectName());
  -			// in order to deploy to Axis
  -			getServer().invoke(
  -				axisDeployer,
  -				"start",
  -				new Object[] { sdi },
  -				new String[] { DeploymentInfo.class.getName()});
  -		} catch (Exception e) {
  -			throw new DeploymentException(e);
  -		} 
  -	}
  -
  -	/**
  -	 * The <code>stop</code> method removes relationships between components.
  -	 *
  -	 * @param sdi a <code>DeploymentInfo</code> value
  -	 * @throws DeploymentException if an error occurs
  -	 */
  -	public void stop(DeploymentInfo sdi) throws DeploymentException {
  -		try {
  -         serviceController.stop(((WebServiceModule) sdi.metaData).
  -            getObjectName());
  -			getServer().invoke(
  -				axisDeployer,
  -				"stop",
  -				new Object[] { sdi },
  -				new String[] { DeploymentInfo.class.getName()});
  -		} catch (Exception e) {
  -			throw new DeploymentException(e);
  -		} 
  -	}
  -
  -	/**
  -	 * The <code>destroy</code> method removes individual components
  -	 *
  -	 * @param sdi a <code>DeploymentInfo</code> value
  -	 * @throws DeploymentException if an error occurs
  -	 */
  -
  -	public void destroy(DeploymentInfo sdi) throws DeploymentException {
  -		try {
  -         serviceController.destroy(((WebServiceModule) sdi.metaData).
  -            getObjectName());
  -			getServer().invoke(
  -				axisDeployer,
  -				"destroy",
  -				new Object[] { sdi },
  -				new String[] { DeploymentInfo.class.getName()});
  -		} catch (Exception e) {
  -			throw new DeploymentException(e);
  -		} 
  -	}
  +         getServer().invoke(axisDeployer, "init", new Object[]{sdi}, new \
String[]{DeploymentInfo.class.getName()});  +      }
  +      catch (Exception e)
  +      {
  +         throw new DeploymentException(e);
  +      }
  +   }
  +
  +   /**
  +    * Set up the components of the deployment that do not
  +    * refer to other components
  +    *
  +    * @param sdi a <code>DeploymentInfo</code> value
  +    * @throws DeploymentException      Failed to deploy
  +    */
  +   public void create(DeploymentInfo sdi) throws DeploymentException
  +   {
  +      // in order to deploy to Axis
  +      try
  +      {
  +         WebServiceModule module = (WebServiceModule) sdi.metaData;
  +         serviceController.create(module.getObjectName(), \
module.getDependencies());  +         getServer().invoke(axisDeployer, "create", new \
Object[]{sdi}, new String[]{DeploymentInfo.class.getName()});  +      }
  +      catch (Exception e)
  +      {
  +         throw new DeploymentException(e);
  +      }
  +   }
  +
  +   /**
  +    * The <code>start</code> method sets up relationships with other components.
  +    *
  +    * At this point the EJB or Web App should already heve been created
  +    *
  +    * @param sdi a <code>DeploymentInfo</code> value
  +    * @throws DeploymentException if an error occurs
  +    */
  +   public void start(DeploymentInfo sdi) throws DeploymentException
  +   {
  +      try
  +      {
  +         serviceController.start(((WebServiceModule) \
sdi.metaData).getObjectName());  +         // in order to deploy to Axis
  +         getServer().invoke(axisDeployer, "start", new Object[]{sdi}, new \
String[]{DeploymentInfo.class.getName()});  +      }
  +      catch (Exception e)
  +      {
  +         throw new DeploymentException(e);
  +      }
  +   }
  +
  +   /**
  +    * The <code>stop</code> method removes relationships between components.
  +    *
  +    * @param sdi a <code>DeploymentInfo</code> value
  +    * @throws DeploymentException if an error occurs
  +    */
  +   public void stop(DeploymentInfo sdi) throws DeploymentException
  +   {
  +      try
  +      {
  +         serviceController.stop(((WebServiceModule) \
sdi.metaData).getObjectName());  +         getServer().invoke(axisDeployer, "stop", \
new Object[]{sdi}, new String[]{DeploymentInfo.class.getName()});  +      }
  +      catch (Exception e)
  +      {
  +         throw new DeploymentException(e);
  +      }
  +   }
  +
  +   /**
  +    * The <code>destroy</code> method removes individual components
  +    *
  +    * @param sdi a <code>DeploymentInfo</code> value
  +    * @throws DeploymentException if an error occurs
  +    */
  +
  +   public void destroy(DeploymentInfo sdi) throws DeploymentException
  +   {
  +      try
  +      {
  +         serviceController.destroy(((WebServiceModule) \
sdi.metaData).getObjectName());  +         getServer().invoke(axisDeployer, \
"destroy", new Object[]{sdi}, new String[]{DeploymentInfo.class.getName()});  +      \
}  +      catch (Exception e)
  +      {
  +         throw new DeploymentException(e);
  +      }
  +   }
   
   }
  
  
  
  1.2       +47 -39    \
contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/WebServiceModule.java  
  Index: WebServiceModule.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/jboss.net/src/main/org/jboss/net/ws4ee/server/WebServiceModule.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebServiceModule.java	31 Oct 2003 18:23:47 -0000	1.1
  +++ WebServiceModule.java	31 Oct 2003 23:38:16 -0000	1.2
  @@ -5,76 +5,77 @@
    * See terms of license at gnu.org.
    */
   
  -// $Id: WebServiceModule.java,v 1.1 2003/10/31 18:23:47 cgjung Exp $
  +// $Id: WebServiceModule.java,v 1.2 2003/10/31 23:38:16 tdiesler Exp $
   
   /*
  - * Created on 
  + * Created on
    *
    * To change the template for this generated file go to
    * Window - Preferences - Java - Code Generation - Code and Comments
    */
   package org.jboss.net.ws4ee.server;
   
  -import java.io.IOException;
  -import java.util.ArrayList;
  -import java.util.Collection;
  -
  -import javax.management.MalformedObjectNameException;
  -import javax.management.ObjectName;
  -import javax.wsdl.WSDLException;
  -import javax.xml.parsers.DocumentBuilder;
  -
   import org.jboss.deployment.DeploymentInfo;
   import org.jboss.ejb.SessionContainer;
   import org.jboss.mx.util.ObjectNameConverter;
   import org.jboss.mx.util.ObjectNameFactory;
   import org.jboss.net.ws4ee.metadata.WebserviceDescription;
   import org.jboss.net.ws4ee.metadata.Webservices;
  -
   import org.jboss.system.ServiceMBeanSupport;
   import org.xml.sax.SAXException;
   
  +import javax.management.MalformedObjectNameException;
  +import javax.management.ObjectName;
  +import javax.wsdl.WSDLException;
  +import javax.xml.parsers.DocumentBuilder;
  +import java.io.IOException;
  +import java.util.ArrayList;
  +import java.util.Collection;
  +
   /**
    * <p>
    * J2EE web service deployment module.
    * </p>
  - * <p> 
  - * Should be registered in JMX in order to connect to the 
  - * WAR/EJB modules (and their meta-data). Caters for correct 
  + * <p>
  + * Should be registered in JMX in order to connect to the
  + * WAR/EJB modules (and their meta-data). Caters for correct
    * startup sequence when setting up the final axis meta-data.
    * </p>
    * @since 30.10.2003
    * @author <a href="mailto:Christoph.Jung@infor.de">Christoph G. Jung</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    * @jmx.mbean extends="org.jboss.system.ServiceMBean"
    */
   
  -public class WebServiceModule extends ServiceMBeanSupport implements \
WebServiceModuleMBean {  +public class WebServiceModule extends ServiceMBeanSupport \
implements WebServiceModuleMBean  +{
   
      protected boolean verify;
      protected final Webservices metaData;
      protected final ObjectName objectName;
      protected final DeploymentInfo info;
      protected final DocumentBuilder documentBuilder;
  -   
  +
      public static final String BASE_WS_MODULE_NAME = \
                "jboss.j2ee:service=WebServiceModule";
      public static final ObjectName WS_MODULE_QUERY_NAME = \
                ObjectNameFactory.create(BASE_WS_MODULE_NAME + ",*");
  -    
  +
      /** convert deployment names to jmx names */
  -   public static ObjectName convertDeploymentInfoToModuleObjectName(DeploymentInfo \
                di) throws MalformedObjectNameException {
  -      return ObjectNameConverter.convert(BASE_WS_MODULE_NAME+",module="+di.shortName);
  +   public static ObjectName convertDeploymentInfoToModuleObjectName(DeploymentInfo \
di) throws MalformedObjectNameException  +   {
  +      return ObjectNameConverter.convert(BASE_WS_MODULE_NAME + ",module=" + \
di.shortName);  }
  -  
  +
      /**
       *  construct a new module
       */
  -   public WebServiceModule(DeploymentInfo di, DocumentBuilder builder) throws \
                MalformedObjectNameException, IOException, SAXException, \
                WSDLException {
  -      info=di;
  +   public WebServiceModule(DeploymentInfo di, DocumentBuilder builder) throws \
MalformedObjectNameException, IOException, SAXException, WSDLException  +   {
  +      info = di;
         // use the parent for naming purposes
         objectName = convertDeploymentInfoToModuleObjectName(info.parent);
  -      documentBuilder=builder;
  +      documentBuilder = builder;
         di.document = builder.parse(di.documentUrl.openStream());
  -      metaData=new Webservices(di.document.getDocumentElement(),builder,this);
  +      metaData = new Webservices(di.document.getDocumentElement(), builder, this);
      }
   
      /**
  @@ -82,37 +83,43 @@
       * to particular ejbs with the correct container
       * @jmx.managed-operation
       */
  -   public void registerEJBContainer(SessionContainer container) {
  +   public void registerEJBContainer(SessionContainer container)
  +   {
         metaData.registerEJBContainer(container);
      }
  -   
  -   /** 
  -    * return web service description belonging to the given ids 
  +
  +   /**
  +    * return web service description belonging to the given ids
       * @jmx.managed-operation
       */
  -   public WebserviceDescription getWebServiceDescription(int id) {
  +   public WebserviceDescription getWebServiceDescription(int id)
  +   {
         return metaData.getWebserviceDescription(id);
      }
  -   
  +
      /** return the objectname of this module */
  -   public ObjectName getObjectName() {
  -      return objectName;      
  +   public ObjectName getObjectName()
  +   {
  +      return objectName;
      }
  -   
  +
      /** return dependencies of this module */
  -   public Collection getDependencies() {
  +   public Collection getDependencies()
  +   {
         // TODO list ejb and war modules when ejb-link or servlet-link are present
         return new ArrayList();
      }
  -   
  +
      /* (non-Javadoc)
       * @see org.jboss.system.ServiceMBeanSupport#startService()
       */
  -   protected void startService() throws Exception {
  +   protected void startService() throws Exception
  +   {
         super.startService();
         info.document = metaData.getDeploymentWSDD(documentBuilder);
         // verify the structure of webservices.xml
  -      if(verify) {
  +      if (verify)
  +      {
            metaData.verify(log);
         }
      }
  @@ -120,7 +127,8 @@
      /**
       * @return
       */
  -   public DeploymentInfo getDeploymentInfo() {
  +   public DeploymentInfo getDeploymentInfo()
  +   {
         return info;
      }
   
  
  
  


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
jboss-cvs-commits mailing list
jboss-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-cvs-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic