Package com.caucho.ejb.server

Examples of com.caucho.ejb.server.AbstractServer


    Iterator<String> iter = _serverMap.keySet().iterator();
    while (iter.hasNext()) {
      String name = iter.next();

      AbstractServer server = _serverMap.get(name);

      if (server.getLocalObject(null) == null)
        continue;

      if (name.startsWith(ejbName)) {
        int prefixLength = ejbName.length();
        int p = name.indexOf('/', prefixLength);
View Full Code Here


    Iterator<String> iter = _serverMap.keySet().iterator();
    while (iter.hasNext()) {
      String name = iter.next();

      AbstractServer server = _serverMap.get(name);
    }

    if (children.size() == 0)
      return null;
    else
View Full Code Here

   */
  @Override
  public AbstractServer deployServer(EjbContainer ejbContainer,
                                     JavaClassGenerator javaGen)
      throws ClassNotFoundException, ConfigException {
    AbstractServer server;

    if (Stateless.class.equals(getSessionType()))
      server = new StatelessManager(ejbContainer, getAnnotatedType());
    else if (Stateful.class.equals(getSessionType()))
      server = new StatefulManager(ejbContainer, getAnnotatedType());
    else if (Singleton.class.equals(getSessionType()))
      server = new SingletonManager(ejbContainer, getAnnotatedType());
    else
      throw new IllegalStateException(String.valueOf(getSessionType()));

    server.setModuleName(getEJBModuleName());
    server.setEJBName(getEJBName());
    server.setMappedName(getMappedName());
    server.setId(getEJBModuleName() + "#" + getEJBName());
    server.setContainerTransaction(_isContainerTransaction);

    server.setEjbClass(loadClass(getEJBClass().getName()));

    ArrayList<ApiClass> remoteList = _sessionBean.getRemoteApi();
    if (remoteList.size() > 0) {
      ArrayList<Class> classList = new ArrayList<Class>();
      for (ApiClass apiClass : remoteList) {
        classList.add(loadClass(apiClass.getName()));
      }

      server.setRemoteApiList(classList);
    }

    /*
     * if (getRemote21() != null)
     * server.setRemote21(loadClass(getRemote21().getName()));
     */

    ArrayList<ApiClass> localList = _sessionBean.getLocalApi();
    if (localList.size() > 0) {
      ArrayList<Class> classList = new ArrayList<Class>();
      for (ApiClass apiClass : localList) {
        classList.add(loadClass(apiClass.getName()));
      }

      server.setLocalApiList(classList);
    }

    /*
     * if (getLocal21() != null)
     * server.setLocal21(loadClass(getLocal21().getName()));
     */

    Class contextImplClass = javaGen.loadClass(getSkeletonName());

    server.setContextImplClass(contextImplClass);

    Class beanClass = javaGen.loadClass(getEJBClass().getName());

    Class[] classes = contextImplClass.getDeclaredClasses();

    for (Class aClass : classes) {
      if (getEJBClass().isAssignableFrom(aClass)) {
        server.setBeanImplClass(aClass);

        break;
      }
    }

    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();

    try {
      thread.setContextClassLoader(server.getClassLoader());

      EjbProducer<?> producer = server.getProducer();

      producer.setInjectionTarget(getInjectionTarget());

      producer.setInitProgram(getInitProgram());

View Full Code Here

        objectId = queryString.substring(p + 1);
      else
        objectId = queryString;
    }

    AbstractServer server = _serverMap.get(serverId);
   
    if (server == null)
      server = getProtocolManager().getServerByEJBName(serverId);

    if (server == null) {
View Full Code Here

    while (name.startsWith("/"))
      name = name.substring(1);
   
    EjbProtocolManager container = _protocol.getProtocolManager();
   
    AbstractServer server;

    server = container.getServerByServerId(name);

    if (server == null)
      server = container.getServerByEJBName(name);
View Full Code Here

         Hessian2Output out)
    throws Throwable
  {
    EjbProtocolManager container = _protocol.getProtocolManager();
   
    AbstractServer server = container.getServerByEJBName(_prefix);

    ArrayList children;

    if (server != null) {
      throw new UnsupportedOperationException(getClass().getName());
View Full Code Here

      for (EjbBean bean : beanConfig) {
        if (beanList.contains(bean))
          continue;

        AbstractServer server = initBean(bean, javaGen);
        ArrayList<String> dependList = bean.getBeanDependList();

        for (String depend : dependList) {
          for (EjbBean b : beanConfig) {
            if (bean == b)
              continue;

            if (depend.equals(b.getEJBName())) {
              beanList.add(b);

              AbstractServer dependServer = initBean(b, javaGen);

              initResources(b, dependServer);

              thread.setContextClassLoader(server.getClassLoader());
            }
View Full Code Here

  }

  private AbstractServer initBean(EjbBean bean, JavaClassGenerator javaGen)
    throws Exception
  {
    AbstractServer server = bean.deployServer(_ejbContainer, javaGen);

    server.init();

    return server;
  }
View Full Code Here

TOP

Related Classes of com.caucho.ejb.server.AbstractServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.