Package org.jboss.ejb3.proxy.impl.jndiregistrar

Examples of org.jboss.ejb3.proxy.impl.jndiregistrar.JndiReferenceBindingSet


   private PersistenceUnitDependencyResolver persistenceUnitDependencyResolver;

   public ClientENCInjectionContainer(VFSDeploymentUnit unit, JBossClientMetaData xml, Class<?> mainClass, String applicationClientName, ClassLoader classLoader,
         Context encCtx, PersistenceUnitDependencyResolver persistenceUnitDependencyResolver) throws NamingException
   {
      super(new SimpleJavaEEModule((unit.getParent() != null ? unit.getParent().getSimpleName() : null), unit.getSimpleName()));
      if (mainClass == null)
         throw new NullPointerException("mainClass is mandatory");
      if (applicationClientName == null)
         throw new NullPointerException("applicationClientName is mandatory");
      if (classLoader == null)
View Full Code Here


   }

   public TomcatInjectionContainer(WebApplication appInfo, DeploymentUnit unit, org.apache.catalina.Context catalinaContext,
         PersistenceUnitDependencyResolver resolver, Set<String> dynamicClassLoaders, JavaEEComponent component, InjectionManager injectionManager)
   {
      super(new SimpleJavaEEModule(appInfo.getName()));

      assert component != null : "component is null";

      this.unit = unit;
      this.appInfo = appInfo;
View Full Code Here

      if(result instanceof JBossGenericBeanMetaData)
      {
         log.warn("FIXME: EJBTHREE-1227: JBossGenericBeanMetaData found for '" + ejbName + "' instead of " + enterpriseBeanMetaDataClass);
         if(enterpriseBeanMetaDataClass.equals(JBossSessionBeanMetaData.class))
         {
            result = new JBossSessionGenericWrapper((JBossGenericBeanMetaData) result);
         }
         else if(enterpriseBeanMetaDataClass.equals(JBossMessageDrivenBeanMetaData.class))
         {
            result = new JBossMessageDrivenBeanGenericWrapper((JBossGenericBeanMetaData) result);
         }
View Full Code Here

    * </p>
    *
    */
   protected void initMetaDataBasedAnnotationRepository()
   {
      this.metadataBasedAnnotationRepo = new AnnotationRepositoryToMetaData(this.beanClass, this.xml, name, this.classloader);
      List<MetaDataBridge<InterceptorMetaData>> interceptorBridges = new ArrayList<MetaDataBridge<InterceptorMetaData>>();
      interceptorBridges.add(new InterceptorMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new AdditiveBeanInterceptorMetaDataBridge(this.beanClass, this.classloader, this.xml));
     
View Full Code Here

         registeredPoolName = PoolDefaults.POOL_IMPLEMENTATION_THREADLOCAL;
      }
      int maxSize = poolAnnotation.maxSize();
      long timeout = poolAnnotation.timeout();
      PoolFactoryRegistry registry = deployment.getPoolFactoryRegistry();
      PoolFactory factory = registry.getPoolFactory(registeredPoolName);
      pool = factory.createPool();
      pool.initialize(this, maxSize, timeout);

      resolveInjectors();
      pool.setInjectors(injectors.toArray(new Injector[injectors.size()]));
   }
View Full Code Here

         // Default the Pool Implementation
         registeredPoolName = PoolDefaults.POOL_IMPLEMENTATION_THREADLOCAL;
      }
      int maxSize = poolAnnotation.maxSize();
      long timeout = poolAnnotation.timeout();
      PoolFactoryRegistry registry = deployment.getPoolFactoryRegistry();
      PoolFactory factory = registry.getPoolFactory(registeredPoolName);
      pool = factory.createPool();
      pool.initialize(this, maxSize, timeout);

      resolveInjectors();
      pool.setInjectors(injectors.toArray(new Injector[injectors.size()]));
View Full Code Here

      {
         this.id = null;
      }
      else
      {
         SessionProxyInvocationHandler handler = (SessionProxyInvocationHandler) Proxy.getInvocationHandler(reference);
         id = (Serializable) handler.getTarget();
      }

      @Deprecated
      Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();
View Full Code Here

      {
         final AsyncLocalBusiness bean = (AsyncLocalBusiness) NAMING_CONTEXT.lookup(AsyncBean.class.getSimpleName()
               + JNDI_SUFFIX_LOCAL_BUSINESS);
         log.info(bean.toString());
         log.info(bean.getClass().toString());
         final SessionProxyInvocationHandlerBase handler = (SessionProxyInvocationHandlerBase) Proxy
               .getInvocationHandler(bean);
         log.info("INTERCEPTORS: " + Arrays.asList(handler.getInterceptors()).toString());

         final Future<Thread> invocation = bean.getThreadOfExecution();

         // Block and test
         final Thread beanThread = invocation.get(3, TimeUnit.SECONDS);
View Full Code Here

    * associated with the <code>beanClusteringInfo</code>'s <code>FamilyWrapper</code> to
    * reflect the new cluster topoloyg, and rebinds the reference in JNDI.
    */
   public void clusterTopologyChanged(ProxyClusteringInfo beanClusteringInfo)
   {
      JndiReferenceBindingSet bindings = null;
      BeanClusteringRegistryInfo registryEntry = bindingsByContainer.get(beanClusteringInfo.getContainerName());
      if (registryEntry != null)
      {
         bindings = registryEntry.bindings;
      }

      if (bindings == null)
      {
         // We aren't handling this bean
         return;
      }

      Context context = bindings.getContext();

      FamilyClusterInfo fci = beanClusteringInfo.getFamilyWrapper().get();
      String familyName = fci.getFamilyName();
      log.debug("Cluster topology changed for family " + familyName + " new view id " + fci.getCurrentViewId()
            + " - Updating JNDI bindings for container " + beanClusteringInfo.getContainerName());

      for (JndiReferenceBinding binding : bindings.getDefaultRemoteBindings())
      {
         RefAddr refAddr = getFirstRefAddr(binding.getReference(),
               ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME);
         if (refAddr != null && familyName.equals(refAddr.getContent()))
         {
            redecorateReferenceForClusteringTargets(binding.getReference(), fci);
            rebind(context, binding.getJndiName(), binding.getReference());
         }

         // The remote proxyfactory in JNDI too needs to be updated with the changes in the
         // clustering family. This involves unbinding the remote proxyfactory from JNDI,
         // creating a new proxy for the proxyfactory with this new FamilyCluster info
         // and finally binding this new proxy for the proxyfactory to the JNDI
         String proxyFactoryKey = this.getSingleRequiredRefAddr(binding.getReference(),
               ProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_PROXY_FACTORY_REGISTRY_KEY);
         // first create a new proxy. if we run into problems creating a new proxy,
         // let's NOT unbind the existing one since a change in topology should not
         // result in loss of proxy factory
         ProxyFactory existingProxyFactoryInJNDI = null;
         try
         {
            existingProxyFactoryInJNDI = (ProxyFactory) context.lookup(proxyFactoryKey);

         }
         catch (NamingException ne)
         {
            // ignore and skip. If there is not proxyfactory bound or if there is some other
            // issue related to naming, let's not try to "update" the proxy factory.
            log.debug("Could not update the cluster topology changes to proxyfactory at key " + proxyFactoryKey);
            continue;
         }
         // create a new proxy to proxyfactory with the available information in JNDI Reference,
         // the previously bound proxy to the proxyfactory and the beanClusteringInfo which has
         // contains the updated information of the cluster topology
         ProxyFactory updatedProxyToProxyFactory = this.updateProxyForRemoteProxyFactory(proxyFactoryKey, binding
               .getReference(), existingProxyFactoryInJNDI, beanClusteringInfo);
         try
         {
            Util.rebind(context, proxyFactoryKey, updatedProxyToProxyFactory);
            log.debug("Bound an updated proxyfactory at key " + proxyFactoryKey);
         }
         catch (NamingException ne)
         {
            // let's just log a WARN since we don't want the other operations to fail because of this
            log.warn("Exception while rebinding a new proxyfactory at key " + proxyFactoryKey
                  + " with updated clustered topology", ne);
         }

      }

      for (JndiReferenceBinding binding : bindings.getHomeRemoteBindings())
      {
         RefAddr refAddr = getFirstRefAddr(binding.getReference(),
               ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME);
         if (refAddr != null && familyName.equals(refAddr.getContent()))
         {
            redecorateReferenceForClusteringTargets(binding.getReference(), fci);
            rebind(context, binding.getJndiName(), binding.getReference());
         }
      }

      for (Set<JndiReferenceBinding> businessBindings : bindings.getBusinessRemoteBindings().values())
      {
         for (JndiReferenceBinding binding : businessBindings)
         {
            RefAddr refAddr = getFirstRefAddr(binding.getReference(),
                  ClusteredProxyFactoryReferenceAddressTypes.REF_ADDR_TYPE_CLUSTER_FAMILY_NAME);
View Full Code Here

   @Override
   protected JndiReferenceBindingSet createJndiReferenceBindingSet(final Context context,
         final JBossSessionBeanMetaData smd, final ClassLoader cl, final String containerName,
         final String containerGuid, final Advisor advisor)
   {
      JndiReferenceBindingSet bindings = super.createJndiReferenceBindingSet(context, smd, cl, containerName,
            containerGuid, advisor);

      decorateReferencesForClustering(bindings);

      // Store ref to bindings so we can rebind upon topology changes
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.proxy.impl.jndiregistrar.JndiReferenceBindingSet

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.