Package org.jboss.ejb

Examples of org.jboss.ejb.EJBProxyFactoryContainer


            String secDomain = container.getSecurityManager().getSecurityDomain();
            context.setValue(InvocationKey.SECURITY_DOMAIN, secDomain);
         }
        
         ClientContainer client = null;
         EJBProxyFactoryContainer pfc = (EJBProxyFactoryContainer) container;
         Class[] ifaces = {pfc.getHomeClass(), Class.forName("javax.ejb.Handle")};
         if( includeIClientIface )
         {
            ifaces = new Class[] {IClientContainer.class, pfc.getHomeClass(),
                           Class.forName("javax.ejb.Handle")};
            client = new ClientContainerEx(context);
         }
         else
         {
            client = new ClientContainer(context);
         }
         loadInterceptorChain(homeInterceptorClasses, client);

         // Create the EJBHome
         this.home = (EJBHome) Proxy.newProxyInstance(
               // Class loader pointing to the right classes from deployment
               pfc.getHomeClass().getClassLoader(),
               // The classes we want to implement home and handle
               ifaces,
               // The home proxy as invocation handler
               client);

         // Create stateless session object
         // Same instance is used for all objects
         if(ejbMetaData.isStatelessSession() == true)
         {
            // Create a stack from the description (in the future) for now we hardcode it
            context = new InvocationContext();

            context.setObjectName(jmxNameHashInteger);
            context.setValue(InvocationKey.JNDI_NAME, jndiBinding);
            // The behavior for home proxying should be isolated in an interceptor FIXME
            context.setInvoker(beanInvoker);
            context.setInvokerProxyBinding(invokerMetaData.getName());
            context.setValue(InvocationKey.EJB_HOME, home);
           
            if(container.getSecurityManager() != null)
            {
               String secDomain = container.getSecurityManager().getSecurityDomain();
               context.setValue(InvocationKey.SECURITY_DOMAIN, secDomain);
            }

            Class[] ssifaces = {pfc.getRemoteClass()};
            if( includeIClientIface )
            {
               ssifaces = new Class[] {IClientContainer.class, pfc.getRemoteClass()};              
               client = new ClientContainerEx(context);              
            }
            else
            {
               client = new ClientContainer(context);
            }
            loadInterceptorChain(beanInterceptorClasses, client);

            this.statelessObject =
               (EJBObject)Proxy.newProxyInstance(
                  // Correct CL
                  pfc.getRemoteClass().getClassLoader(),
                  // Interfaces
                  ssifaces,
                  // SLSB proxy as invocation handler
                  client
               );
         }
         else
         {
            // this is faster than newProxyInstance
            Class[] intfs = {pfc.getRemoteClass()};
            if( this.includeIClientIface )
            {
               intfs = new Class[]{IClientContainer.class, pfc.getRemoteClass()};
            }
            Class proxyClass = Proxy.getProxyClass(pfc.getRemoteClass().getClassLoader(), intfs);
            final Class[] constructorParams = {InvocationHandler.class};
            proxyClassConstructor = proxyClass.getConstructor(constructorParams);
         }

View Full Code Here


            }

            // Initialize the securityProxy
            try
            {
               EJBProxyFactoryContainer  ic =
                  (EJBProxyFactoryContainer)container;
               Class beanHome = ic.getHomeClass();
               Class beanRemote = ic.getRemoteClass();
               Class beanLocalHome = ic.getLocalHomeClass();
               Class beanLocal = ic.getLocalClass();
               if( beanLocal == null )
               {
                  securityProxy.init(beanHome, beanRemote, securityManager);
               }
               else
View Full Code Here

   public void start()
      throws Exception
   {
      BeanMetaData metaData = container.getBeanMetaData();
      EJBProxyFactoryContainer invokerContainer =
         (EJBProxyFactoryContainer) container;
      localHomeClass = invokerContainer.getLocalHomeClass();
      localClass = invokerContainer.getLocalClass();
      if(localHomeClass == null || localClass == null)
      {
         log.debug(metaData.getEjbName()
            +
            " cannot be Bound, doesn't " +
View Full Code Here

   // EJBProxyFactory implementation -------------------------------
   public EJBLocalHome getEJBLocalHome()
   {
      if(home == null)
      {
         EJBProxyFactoryContainer cic = (EJBProxyFactoryContainer) container;
         InvocationHandler handler = new LocalHomeProxy(localJndiName, this);
         ClassLoader loader = ClassLoaderAction.UTIL.get(cic.getLocalHomeClass());
         Class[] interfaces = {cic.getLocalHomeClass()};

         home = (EJBLocalHome) Proxy.newProxyInstance(loader,
            interfaces,
            handler);
      }
View Full Code Here

   public EJBLocalObject getStatelessSessionEJBLocalObject()
   {
      if(statelessObject == null)
      {
         EJBProxyFactoryContainer cic = (EJBProxyFactoryContainer) container;
         InvocationHandler handler =
            new StatelessSessionProxy(localJndiName, this);
         ClassLoader loader = ClassLoaderAction.UTIL.get(cic.getLocalClass());
         Class[] interfaces = {cic.getLocalClass()};

         statelessObject = (EJBLocalObject) Proxy.newProxyInstance(loader,
            interfaces,
            handler);
      }
View Full Code Here

/* 389 */       context.setInvoker(this.homeInvoker);
/* 390 */       context.setValue(InvocationKey.EJB_METADATA, this.ejbMetaData);
/* 391 */       context.setInvokerProxyBinding(this.invokerMetaData.getName());
/*     */
/* 393 */       ClientContainer client = null;
/* 394 */       EJBProxyFactoryContainer pfc = (EJBProxyFactoryContainer)this.container;
/* 395 */       Class[] ifaces = { pfc.getHomeClass(), Class.forName("javax.ejb.Handle") };
/* 396 */       if (this.includeIClientIface)
/*     */       {
/* 398 */         ifaces = new Class[] { IClientContainer.class, pfc.getHomeClass(), Class.forName("javax.ejb.Handle") };
/*     */
/* 400 */         client = new ClientContainerEx(context);
/*     */       }
/*     */       else
/*     */       {
/* 404 */         client = new ClientContainer(context);
/*     */       }
/* 406 */       loadInterceptorChain(this.homeInterceptorClasses, client);
/*     */
/* 409 */       this.home = ((EJBHome)Proxy.newProxyInstance(pfc.getHomeClass().getClassLoader(), ifaces, client));
/*     */
/* 419 */       if (this.ejbMetaData.isStatelessSession() == true)
/*     */       {
/* 422 */         context = new InvocationContext();
/*     */
/* 424 */         context.setObjectName(this.jmxNameHashInteger);
/* 425 */         context.setValue(InvocationKey.JNDI_NAME, this.jndiBinding);
/*     */
/* 427 */         context.setInvoker(this.beanInvoker);
/* 428 */         context.setInvokerProxyBinding(this.invokerMetaData.getName());
/* 429 */         context.setValue(InvocationKey.EJB_HOME, this.home);
/*     */
/* 431 */         Class[] ssifaces = { pfc.getRemoteClass() };
/* 432 */         if (this.includeIClientIface)
/*     */         {
/* 434 */           ssifaces = new Class[] { IClientContainer.class, pfc.getRemoteClass() };
/* 435 */           client = new ClientContainerEx(context);
/*     */         }
/*     */         else
/*     */         {
/* 439 */           client = new ClientContainer(context);
/*     */         }
/* 441 */         loadInterceptorChain(this.beanInterceptorClasses, client);
/*     */
/* 443 */         this.statelessObject = ((EJBObject)Proxy.newProxyInstance(pfc.getRemoteClass().getClassLoader(), ssifaces, client));
/*     */       }
/*     */       else
/*     */       {
/* 456 */         Class[] intfs = { pfc.getRemoteClass() };
/* 457 */         if (this.includeIClientIface)
/*     */         {
/* 459 */           intfs = new Class[] { IClientContainer.class, pfc.getRemoteClass() };
/*     */         }
/* 461 */         Class proxyClass = Proxy.getProxyClass(pfc.getRemoteClass().getClassLoader(), intfs);
/* 462 */         Class[] constructorParams = { InvocationHandler.class };
/* 463 */         this.proxyClassConstructor = proxyClass.getConstructor(constructorParams);
/*     */       }
/*     */
/* 468 */       rebindHomeProxy();
View Full Code Here

/*     */
/*     */   public EJBLocalObject getStatelessSessionEJBLocalObject()
/*     */   {
/* 253 */     if (this.statelessObject == null)
/*     */     {
/* 255 */       EJBProxyFactoryContainer cic = (EJBProxyFactoryContainer)this.container;
/* 256 */       InvocationHandler handler = new StatelessSessionProxy(this.localJndiName, this);
/*     */
/* 258 */       ClassLoader loader = BaseLocalProxyFactory.ClassLoaderAction.UTIL.get(cic.getLocalClass());
/* 259 */       Class[] interfaces = { cic.getLocalClass() };
/*     */
/* 261 */       this.statelessObject = ((EJBLocalObject)Proxy.newProxyInstance(loader, interfaces, handler));
/*     */     }
/*     */
/* 265 */     return this.statelessObject;
View Full Code Here

/*     */
/*     */   public void start()
/*     */     throws Exception
/*     */   {
/* 139 */     BeanMetaData metaData = this.container.getBeanMetaData();
/* 140 */     EJBProxyFactoryContainer invokerContainer = (EJBProxyFactoryContainer)this.container;
/*     */
/* 142 */     this.localHomeClass = invokerContainer.getLocalHomeClass();
/* 143 */     this.localClass = invokerContainer.getLocalClass();
/* 144 */     if ((this.localHomeClass == null) || (this.localClass == null))
/*     */     {
/* 146 */       log.debug(metaData.getEjbName() + " cannot be Bound, doesn't " + "have local and local home interfaces");
/*     */
/* 150 */       return;
View Full Code Here

/*     */
/*     */   public EJBLocalHome getEJBLocalHome()
/*     */   {
/* 237 */     if (this.home == null)
/*     */     {
/* 239 */       EJBProxyFactoryContainer cic = (EJBProxyFactoryContainer)this.container;
/* 240 */       InvocationHandler handler = new LocalHomeProxy(this.localJndiName, this);
/* 241 */       ClassLoader loader = BaseLocalProxyFactory.ClassLoaderAction.UTIL.get(cic.getLocalHomeClass());
/* 242 */       Class[] interfaces = { cic.getLocalHomeClass() };
/*     */
/* 244 */       this.home = ((EJBLocalHome)Proxy.newProxyInstance(loader, interfaces, handler));
/*     */     }
/*     */
/* 248 */     return this.home;
View Full Code Here

/* 103 */           this.securityProxy = ((SecurityProxy)secProxy);
/*     */         }
/*     */
/*     */         try
/*     */         {
/* 109 */           EJBProxyFactoryContainer ic = (EJBProxyFactoryContainer)container;
/*     */
/* 111 */           Class beanHome = ic.getHomeClass();
/* 112 */           Class beanRemote = ic.getRemoteClass();
/* 113 */           Class beanLocalHome = ic.getLocalHomeClass();
/* 114 */           Class beanLocal = ic.getLocalClass();
/* 115 */           if (beanLocal == null)
/*     */           {
/* 117 */             this.securityProxy.init(beanHome, beanRemote, this.securityManager);
/*     */           }
/*     */           else
View Full Code Here

TOP

Related Classes of org.jboss.ejb.EJBProxyFactoryContainer

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.