axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/providers/java EJBProvider.java
Date Tue, 06 Aug 2002 15:59:36 GMT
gdaniels    2002/08/06 08:59:36

  Modified:    java/src/org/apache/axis/deployment/wsdd WSDDService.java
                        WSDDDeployment.java
               java/src/org/apache/axis/configuration FileProvider.java
               java/src/org/apache/axis/providers/java EJBProvider.java
  Log:
  Fix EJB provider (for real this time... sigh).  Deal with null MessageContext
  argument.
  
  Clean up a bit of code in FileProvider/WSDDDeployment as well.
  
  Revision  Changes    Path
  1.78      +6 -0      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java
  
  Index: WSDDService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- WSDDService.java	5 Aug 2002 05:10:47 -0000	1.77
  +++ WSDDService.java	6 Aug 2002 15:59:36 -0000	1.78
  @@ -59,6 +59,7 @@
   import org.apache.axis.EngineConfiguration;
   import org.apache.axis.FaultableHandler;
   import org.apache.axis.Handler;
  +import org.apache.axis.AxisFault;
   import org.apache.axis.description.ServiceDesc;
   import org.apache.axis.encoding.DeserializerFactory;
   import org.apache.axis.encoding.SerializationContext;
  @@ -414,6 +415,11 @@
           }
   
           service.setServiceDescription(desc);
  +        try {
  +            service.getInitializedServiceDesc(null);
  +        } catch (AxisFault axisFault) {
  +            throw new ConfigurationException(axisFault);
  +        }
   
           cachedService = service;
           return service;
  
  
  
  1.43      +1 -0      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java
  
  Index: WSDDDeployment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- WSDDDeployment.java	22 Jul 2002 20:10:04 -0000	1.42
  +++ WSDDDeployment.java	6 Aug 2002 15:59:36 -0000	1.43
  @@ -545,6 +545,7 @@
           ArrayList serviceDescs = new ArrayList();
           for (Iterator i = services.values().iterator(); i.hasNext();) {
               WSDDService service = (WSDDService) i.next();
  +            service.makeNewInstance(this);
               serviceDescs.add(service.getServiceDesc());
           }
           return serviceDescs.iterator();
  
  
  
  1.35      +1 -7      xml-axis/java/src/org/apache/axis/configuration/FileProvider.java
  
  Index: FileProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/configuration/FileProvider.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- FileProvider.java	24 Jul 2002 16:59:14 -0000	1.34
  +++ FileProvider.java	6 Aug 2002 15:59:36 -0000	1.35
  @@ -318,12 +318,6 @@
        * Get an enumeration of the services deployed to this engine
        */
       public Iterator getDeployedServices() throws ConfigurationException {
  -        ArrayList serviceDescs = new ArrayList();
  -        WSDDService [] services = this.deployment.getServices();
  -        for (int i = 0; i < services.length; i++) {
  -            WSDDService service = services[i];
  -            serviceDescs.add(service.getServiceDesc());
  -        }
  -        return serviceDescs.iterator();
  +        return deployment.getDeployedServices();
       }
   }
  
  
  
  1.30      +15 -14    xml-axis/java/src/org/apache/axis/providers/java/EJBProvider.java
  
  Index: EJBProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/EJBProvider.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- EJBProvider.java	6 Aug 2002 03:55:05 -0000	1.29
  +++ EJBProvider.java	6 Aug 2002 15:59:36 -0000	1.30
  @@ -123,7 +123,8 @@
           throws Exception
       {
           // Get the EJB Home object from JNDI
  -        Object ejbHome = getEJBHome(msgContext, clsName);
  +        Object ejbHome = getEJBHome(msgContext.getService(),
  +                                    msgContext, clsName);
   
           // Get the Home class name from the configuration file
           // NOTE: Do we really need to have this in the config file
  @@ -193,26 +194,25 @@
                                       MessageContext msgContext)
           throws AxisFault
       {
  -        if (msgContext == null) {
  -            // FIXME : what should we do here?
  -            return null;
  -        }
  -
           Class interfaceClass = null;
           
           // First try to get the interface class from the configuation
           String remoteName = 
                   (String) getStrOption(OPTION_REMOTEINTERFACENAME, service);
           try {
  +            ClassLoader cl = (msgContext != null) ?
  +                    msgContext.getClassLoader() :
  +                    Thread.currentThread().getContextClassLoader();
  +
               if(remoteName != null){
                   interfaceClass = ClassUtils.forName(remoteName,
                                                       true,
  -                                                    msgContext.getClassLoader());
  +                                                    cl);
               }
               else
               {
                   // Get the EJB Home object from JNDI
  -                Object ejbHome = getEJBHome(msgContext, beanJndiName);
  +                Object ejbHome = getEJBHome(service, msgContext, beanJndiName);
   
                   String homeName = (String)getStrOption(OPTION_HOMEINTERFACENAME,
                                                           service);
  @@ -220,10 +220,10 @@
                       throw new AxisFault(
                               JavaUtils.getMessage("noOption00",
                                                    OPTION_HOMEINTERFACENAME,
  -                                                 msgContext.getTargetService()));
  +                                                 service.getName()));
   
                   // Load the Home class name given in the config file
  -                Class homeClass = ClassUtils.forName(homeName, true, msgContext.getClassLoader());
  +                Class homeClass = ClassUtils.forName(homeName, true, cl);
   
                   // Make sure the object we got back from JNDI is the same type
                   // as the what is specified in the config file
  @@ -259,14 +259,15 @@
       /**
        * Common routine to do the JNDI lookup on the Home interface object
        */ 
  -    private Object getEJBHome(MessageContext msgContext, String beanJndiName)
  +    private Object getEJBHome(SOAPService serviceHandler,
  +                              MessageContext msgContext,
  +                              String beanJndiName)
           throws AxisFault
       {
           Object ejbHome = null;
           
           // Set up an InitialContext and use it get the beanJndiName from JNDI
           try {
  -            Handler serviceHandler =  msgContext.getService();
               Properties properties = null;
   
               // collect all the properties we need to access JNDI:
  @@ -274,7 +275,7 @@
   
               // username
               String username = (String)getStrOption(jndiUsername, serviceHandler);
  -            if (username == null) 
  +            if ((username == null) && (msgContext != null))
                  username = msgContext.getUsername();
               if (username != null) {
                   if (properties == null)
  @@ -284,7 +285,7 @@
   
               // password
               String password = (String)getStrOption(jndiPassword, serviceHandler);
  -            if (password == null)
  +            if ((password == null) && (msgContext != null))
                   password = msgContext.getPassword();
               if (password != null) {
                   if (properties == null)
  
  
  

Mime
View raw message