dblevins    2004/12/22 00:42:38

  Modified:    modules/core/src/java/org/openejb/server/ejbd EjbServer.java
  Added:       modules/core/src/java/org/openejb/server/ejbd
                        EjbServerGBean.java
  Log:

  Basic soap rpc/encoded deployment and container support along with a general 
revamping of the networkservice stacks.
  
  Revision  Changes    Path
  1.4       +8 -1      
openejb/modules/core/src/java/org/openejb/server/ejbd/EjbServer.java
  
  Index: EjbServer.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/server/ejbd/EjbServer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EjbServer.java    9 Apr 2004 19:04:02 -0000       1.3
  +++ EjbServer.java    22 Dec 2004 05:42:38 -0000      1.4
  @@ -53,6 +53,7 @@
   import org.openejb.server.ServiceException;
   import org.openejb.server.ServerService;
   import org.openejb.ContainerIndex;
  +import org.openejb.OpenEJB;
   
   /**
    * @since 11/25/2001
  @@ -60,6 +61,12 @@
   public class EjbServer implements ServerService {
       private EjbDaemon ejbDaemon;
   
  +    static {
  +        // TODO Horrid hack, the concept needs to survive somewhere
  +        if (OpenEJB.getApplicationServer() == null) {
  +            OpenEJB.setApplicationServer(new ServerFederation());
  +        }
  +    }
       public EjbServer() throws Exception {
           ejbDaemon = EjbDaemon.getEjbDaemon();
       }
  
  
  
  1.1                  
openejb/modules/core/src/java/org/openejb/server/ejbd/EjbServerGBean.java
  
  Index: EjbServerGBean.java
  ===================================================================
  /**
   * Redistribution and use of this software and associated documentation
   * ("Software"), with or without modification, are permitted provided
   * that the following conditions are met:
   *
   * 1. Redistributions of source code must retain copyright
   *    statements and notices.  Redistributions must also contain a
   *    copy of this document.
   *
   * 2. Redistributions in binary form must reproduce the
   *    above copyright notice, this list of conditions and the
   *    following disclaimer in the documentation and/or other
   *    materials provided with the distribution.
   *
   * 3. The name "OpenEJB" must not be used to endorse or promote
   *    products derived from this Software without prior written
   *    permission of The OpenEJB Group.  For written permission,
   *    please contact [EMAIL PROTECTED]
   *
   * 4. Products derived from this Software may not be called "OpenEJB"
   *    nor may "OpenEJB" appear in their names without prior written
   *    permission of The OpenEJB Group. OpenEJB is a registered
   *    trademark of The OpenEJB Group.
   *
   * 5. Due credit should be given to the OpenEJB Project
   *    (http://openejb.org/).
   *
   * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
   * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
   * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   *
   * Copyright 2001 (C) The OpenEJB Group. All Rights Reserved.
   *
   * $Id: EjbServerGBean.java,v 1.1 2004/12/22 05:42:38 dblevins Exp $
   */
  package org.openejb.server.ejbd;
  
  import javax.management.ObjectName;
  
  import org.apache.geronimo.gbean.*;
  import org.apache.geronimo.kernel.jmx.JMXUtil;
  import org.apache.geronimo.kernel.Kernel;
  import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
  import org.apache.geronimo.kernel.GBeanNotFoundException;
  import org.openejb.ContainerIndex;
  import org.openejb.server.SocketService;
  
  public class EjbServerGBean {
  
      public static final GBeanInfo GBEAN_INFO;
  
      static {
          GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(EjbServer.class);
  
          infoFactory.addInterface(SocketService.class);
          infoFactory.addReference("ContainerIndex", ContainerIndex.class);
  
          infoFactory.setConstructor(new String[]{"ContainerIndex"});
  
          GBEAN_INFO = infoFactory.getBeanInfo();
      }
  
      public static GBeanInfo getGBeanInfo() {
          return GBEAN_INFO;
      }
  
      public static ObjectName addGBean(Kernel kernel, String name, ObjectName 
containerIndex) throws GBeanAlreadyExistsException, GBeanNotFoundException {
          GBeanData gbean = createGBean(name, containerIndex);
          kernel.loadGBean(gbean, EjbServer.class.getClassLoader());
          kernel.startGBean(gbean.getName());
          return gbean.getName();
      }
  
      public static GBeanData createGBean(String name, ObjectName 
containerIndex) {
          ObjectName gbeanName = 
JMXUtil.getObjectName("openejb:type=EjbServer,name="+name);
  
          GBeanData gbean = new GBeanData(gbeanName, EjbServerGBean.GBEAN_INFO);
          gbean.setReferencePattern("ContainerIndex", containerIndex);
  
          return gbean;
      }
  }
  
  
  

Reply via email to