Package org.jboss.ejb3

Examples of org.jboss.ejb3.KernelAbstraction


         if (binding.invokerName()!=null && binding.invokerName().trim().length() != 0)
         {
            try
            {
               ObjectName connectionON = new ObjectName(binding.invokerName());
               KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
               clientBindUrl = (String)kernelAbstraction.getAttribute(connectionON, "InvokerLocator");
            }
            catch (Exception e)
            {
               log.warn("Unable to find InvokerLocator " + binding.invokerName() + ". Using default. " + e);
               clientBindUrl = RemoteProxyFactory.DEFAULT_CLIENT_BINDING;
            }
         }
         else
         {
            try
            {
               ObjectName connectionON = new ObjectName("jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3");
               KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
               clientBindUrl = (String)kernelAbstraction.getAttribute(connectionON, "InvokerLocator");
            }
            catch (Exception e)
            {
               log.warn("Unable to find default InvokerLocator. Using default. " + e);
               clientBindUrl = RemoteProxyFactory.DEFAULT_CLIENT_BINDING;
            }
         }
      }
      else if (clientBindUrl.indexOf("0.0.0.0") != -1)
      {
         KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
         ObjectName query = new ObjectName("jboss.remoting:type=Connector,handler=ejb3,*");
         Set mbeanSet = kernelAbstraction.getMBeans(query);
        
         URI targetUri = new URI(clientBindUrl);
         Iterator mbeans = mbeanSet.iterator();
         while (mbeans.hasNext())
         {
            ObjectInstance invokerInstance = (ObjectInstance)mbeans.next();
            ObjectName invokerName = invokerInstance.getObjectName();
            String invokerLocator = (String)kernelAbstraction.getAttribute(invokerName, "InvokerLocator");
            URI uri = new URI(invokerLocator);
         
            if (uri.getScheme().equals(targetUri.getScheme()) && uri.getPort() == targetUri.getPort())
            {
               return invokerLocator;
View Full Code Here


      String name = jndiSuffix;
      String jndiName = destinationContext + "/" + jndiSuffix;
     
      ObjectName serverPeerName = new ObjectName("jboss.messaging:service=ServerPeer");
     
      KernelAbstraction kernel = KernelAbstractionFactory.getInstance();
      // invoke the server to create the destination
      Object result = kernel.invoke(serverPeerName,
              methodName,
              new Object[]{name, jndiName},
              new String[]{"java.lang.String", "java.lang.String"});
     
      log.debug("result = " + result);
View Full Code Here

         if (binding.invokerName()!=null && binding.invokerName().trim().length() != 0)
         {
            try
            {
               ObjectName connectionON = new ObjectName(binding.invokerName());
               KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
               clientBindUrl = (String)kernelAbstraction.getAttribute(connectionON, "InvokerLocator");
            }
            catch (Exception e)
            {
               log.warn("Unable to find InvokerLocator " + binding.invokerName() + ". Using default. " + e);
               clientBindUrl = RemoteProxyFactory.DEFAULT_CLIENT_BINDING;
            }
         }
         else
         {
            try
            {
               ObjectName connectionON = new ObjectName("jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3");
               KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
               clientBindUrl = (String)kernelAbstraction.getAttribute(connectionON, "InvokerLocator");
            }
            catch (Exception e)
            {
               log.warn("Unable to find default InvokerLocator. Using default. " + e);
               clientBindUrl = RemoteProxyFactory.DEFAULT_CLIENT_BINDING;
            }
         }
      }
      else if (clientBindUrl.indexOf("0.0.0.0") != -1)
      {
         KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
         ObjectName query = new ObjectName("jboss.remoting:type=Connector,handler=ejb3,*");
         Set mbeanSet = kernelAbstraction.getMBeans(query);
        
         URI targetUri = new URI(clientBindUrl);
         Iterator mbeans = mbeanSet.iterator();
         while (mbeans.hasNext())
         {
            ObjectInstance invokerInstance = (ObjectInstance)mbeans.next();
            ObjectName invokerName = invokerInstance.getObjectName();
            String invokerLocator = (String)kernelAbstraction.getAttribute(invokerName, "InvokerLocator");
            URI uri = new URI(invokerLocator);
         
            if (uri.getScheme().equals(targetUri.getScheme()) && uri.getPort() == targetUri.getPort())
            {
               return invokerLocator;
View Full Code Here

/* 72 */     String name = jndiSuffix;
/* 73 */     String jndiName = destinationContext + "/" + jndiSuffix;
/*    */
/* 75 */     ObjectName serverPeerName = new ObjectName("jboss.messaging:service=ServerPeer");
/*    */
/* 77 */     KernelAbstraction kernel = KernelAbstractionFactory.getInstance();
/*    */
/* 79 */     Object result = kernel.invoke(serverPeerName, methodName, new Object[] { name, jndiName }, new String[] { "java.lang.String", "java.lang.String" });
/*    */
/* 84 */     log.debug("result = " + result);
/*    */   }
View Full Code Here

         if (binding.invokerName()!=null && binding.invokerName().trim().length() != 0)
         {
            try
            {
               ObjectName connectionON = new ObjectName(binding.invokerName());
               KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
               clientBindUrl = (String)kernelAbstraction.getAttribute(connectionON, "InvokerLocator");
            }
            catch (Exception e)
            {
               log.warn("Unable to find InvokerLocator " + binding.invokerName() + ". Using default. " + e);
               clientBindUrl = RemoteProxyFactory.DEFAULT_CLIENT_BINDING;
            }
         }
         else
         {
            try
            {
               ObjectName connectionON = new ObjectName("jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3");
               KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
               clientBindUrl = (String)kernelAbstraction.getAttribute(connectionON, "InvokerLocator");
            }
            catch (Exception e)
            {
               log.warn("Unable to find default InvokerLocator. Using default. " + e);
               clientBindUrl = RemoteProxyFactory.DEFAULT_CLIENT_BINDING;
            }
         }
      }
      else if (clientBindUrl.indexOf("0.0.0.0") != -1)
      {
         KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
         ObjectName query = new ObjectName("jboss.remoting:type=Connector,handler=ejb3,*");
         Set mbeanSet = kernelAbstraction.getMBeans(query);
        
         URI targetUri = new URI(clientBindUrl);
         Iterator mbeans = mbeanSet.iterator();
         while (mbeans.hasNext())
         {
            ObjectInstance invokerInstance = (ObjectInstance)mbeans.next();
            ObjectName invokerName = invokerInstance.getObjectName();
            String invokerLocator = (String)kernelAbstraction.getAttribute(invokerName, "InvokerLocator");
            URI uri = new URI(invokerLocator);
         
            if (uri.getScheme().equals(targetUri.getScheme()) && uri.getPort() == targetUri.getPort())
            {
               return invokerLocator;
View Full Code Here

         if (binding.invokerName()!=null && binding.invokerName().trim().length() != 0)
         {
            try
            {
               ObjectName connectionON = new ObjectName(binding.invokerName());
               KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
               clientBindUrl = (String)kernelAbstraction.getAttribute(connectionON, "InvokerLocator");
            }
            catch (Exception e)
            {
               log.warn("Unable to find InvokerLocator " + binding.invokerName() + ". Using default. " + e);
               clientBindUrl = RemoteProxyFactory.DEFAULT_CLIENT_BINDING;
            }
         }
         else
         {
            try
            {
               ObjectName connectionON = new ObjectName("jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3");
               KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
               clientBindUrl = (String)kernelAbstraction.getAttribute(connectionON, "InvokerLocator");
            }
            catch (Exception e)
            {
               log.warn("Unable to find default InvokerLocator. Using default. " + e);
               clientBindUrl = RemoteProxyFactory.DEFAULT_CLIENT_BINDING;
            }
         }
      }
      else if (clientBindUrl.indexOf("0.0.0.0") != -1)
      {
         KernelAbstraction kernelAbstraction = KernelAbstractionFactory.getInstance();
         ObjectName query = new ObjectName("jboss.remoting:type=Connector,handler=ejb3,*");
         Set mbeanSet = kernelAbstraction.getMBeans(query);
        
         URI targetUri = new URI(clientBindUrl);
         Iterator mbeans = mbeanSet.iterator();
         while (mbeans.hasNext())
         {
            ObjectInstance invokerInstance = (ObjectInstance)mbeans.next();
            ObjectName invokerName = invokerInstance.getObjectName();
            String invokerLocator = (String)kernelAbstraction.getAttribute(invokerName, "InvokerLocator");
            URI uri = new URI(invokerLocator);
         
            if (uri.getScheme().equals(targetUri.getScheme()) && uri.getPort() == targetUri.getPort())
            {
               return invokerLocator;
View Full Code Here

  
   @Override
   protected void registerEJBContainer(Container container) throws Exception
   {
      // Add the jndi supplies
      MCDependencyPolicy dependsPolicy = (MCDependencyPolicy) container.getDependencyPolicy();
      EJBContainer ejbContainer = (EJBContainer) container;
      JBossEnterpriseBeanMetaData beanMD = ejbContainer.getXml();

      ContainerDependencyMetaData cdmd = null;
      if(endpoints != null)
      {
         String ejbKey = "ejb/" + jbossUnit.getRelativePath() + "#" + container.getEjbName();
         cdmd = endpoints.get(ejbKey);
      }
      else
      {
         log.warn(jbossUnit+" has no ContainerDependencyMetaData attachment");
      }

      if(cdmd != null)
      {
         for(String jndiName : cdmd.getJndiNames())
         {
         String supplyName = JNDIKernelRegistryPlugin.JNDI_DEPENDENCY_PREFIX + jndiName;
         AbstractSupplyMetaData supply = new AbstractSupplyMetaData(supplyName);
         dependsPolicy.getSupplies().add(supply);
         }
      }

      // EJBTHREE-1335: container name in meta data
      generateContainerName(container, beanMD);
     
      // setup switchboard
      Barrier switchBoard = this.getSwitchBoardBarrier(container);
      // the container cannot function without an SwitchBoard Barrier
      if (switchBoard == null)
      {
         throw new RuntimeException("No SwitchBoard Barrier found for bean: " + container.getEjbName() + " in unit: "
               + this.jbossUnit + " (or its component deployment unit)");
      }
      // add dependency on START (and not INSTALLED) state of Switchboard, since the container only requires a fully populated ENC context,
      // but doesn't require a invokable context. An invokable context is only needed by Injector.
      dependsPolicy.addDependency(this.createSwitchBoardDependency(ejbContainer, switchBoard));
      log.debug("Added dependency on Switchboard " + switchBoard.getId() + " for EJB container " + ejbContainer.getName());
     
     
      // create and setup Injector(s) for InjectionManager 
      InjectionManager injectionManager = this.getInjectionManager(container);
View Full Code Here

      }

      // Create the metadata for the bean to install
      AbstractBeanMetaData bean = new AbstractBeanMetaData(name, service.getClass().getName());
      bean.setConstructor(new AlreadyInstantiated(service));
      MCDependencyPolicy policy = (MCDependencyPolicy) dependencies;
      bean.setDepends(policy.getDependencies());
      bean.setDemands(policy.getDemands());
      bean.setSupplies(policy.getSupplies());
      log.info("installing bean: " + name);
      log.info("  with dependencies:");
      for (Object obj : policy.getDependencies())
      {
         Object msgObject = obj;
         if (obj instanceof AbstractDemandMetaData)
         {
            msgObject = ((AbstractDemandMetaData)obj).getDemand();
         }
         log.info("\t" + msgObject);
      }
      log.info("  and demands:");
      for(DemandMetaData dmd : policy.getDemands())
      {
         log.info("\t" + dmd.getDemand() + "; Required: " + dmd.getWhenRequired().getStateString());
      }
      log.info("  and supplies:");
      for(SupplyMetaData smd : policy.getSupplies())
      {
         log.info("\t" + smd.getSupply());
      }

      if(service instanceof EJBContainer)
View Full Code Here

      if(this.cache!=null && this.cache.isStarted())
      {
         return;
      }
     
      Cache cacheConfig = getAnnotation(Cache.class);
      CacheFactoryRegistry registry = getCacheFactoryRegistry();
      Ejb3CacheFactory factory = registry.getCacheFactory(cacheConfig.value());
      this.cache = factory.createCache();
      this.cache.initialize(this);
      this.cache.start();
   }
View Full Code Here

   public StatefulBeanContext create(Class<?>[] initTypes, Object[] initValues)
   {
      StatefulBeanContext sfctx = (StatefulBeanContext) createBeanContext();
      // Tell context how to handle replication
      CacheConfig config = getAnnotation(CacheConfig.class);
      if (config != null)
      {
         sfctx.setReplicationIsPassivation(config.replicationIsPassivation());
      }

      // this is for propagated extended PC's
      sfctx = sfctx.pushContainedIn();
     
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.KernelAbstraction

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.