Package org.jboss.ejb3

Examples of org.jboss.ejb3.KernelAbstraction


            final String ejbName = ejbMD.determineContainerName();

            if (ejbMD.getEjbClass() != null)
            {
               this.log.debug("Creating webservice EJB adapter for: " + ejbName);
               final EJBContainer ejbContainer = this.getContainer(ejb3Deployment, ejbMD);
               endpoints.add(new WebServiceDeclarationAdapter(ejbMD, ejbContainer, unit.getClassLoader()));
            }
            else
            {
               this.log.warn("Ingoring EJB deployment with null classname: " + ejbName);
View Full Code Here


      EJBContainer container = null;
      EndpointInfo endpoint = endpointResolver.getEndpointInfo(businessIntf, EndpointType.EJB, vfsContext);
      if(endpoint != null)
      {
         log.debug("Found endpoint for interface: "+businessIntf+", endpoint: "+endpoint);
         Ejb3Deployment deployment = deployments.get(endpoint.getPathName());
         String ejbObjectName = JavaEEComponentHelper.createObjectName(deployment, endpoint.getName());
         ObjectName ejbON;
         try
         {
            ejbON = new ObjectName(ejbObjectName);
         }
         catch (Exception e)
         {
            throw new IllegalStateException("Failed to build ejb container ObjectName", e);
         }
         container = (EJBContainer) deployment.getContainer(ejbON);
         // TODO: container = deployment.getEjbContainerForEjbName(endpoint.getName());
      }
      else
      {
         log.debug("Failed to find endpoint for interface: "+businessIntf);
View Full Code Here

      // First try the ejbLink
      EndpointInfo endpoint = endpointResolver.getEndpointInfo(ejbLink, EndpointType.EJB, vfsContext);
      if(endpoint != null)
      {
         log.debug("Found endpoint for ejbLink: "+ejbLink+", endpoint: "+endpoint);
         Ejb3Deployment deployment = deployments.get(endpoint.getPathName());
         String ejbObjectName = JavaEEComponentHelper.createObjectName(deployment, endpoint.getName());
         ObjectName ejbON;
         try
         {
            ejbON = new ObjectName(ejbObjectName);
         }
         catch (Exception e)
         {
            throw new IllegalStateException("Failed to build ejb container ObjectName", e);
         }
         container = (EJBContainer) deployment.getContainer(ejbON);
         // TODO: container = deployment.getEjbContainerForEjbName(endpoint.getName());         container = deployment.getEjbContainerForEjbName(endpoint.getName());
      }
      else
      {
         log.debug("Failed to find endpoint for ejbLink: "+ejbLink);
View Full Code Here

   }

   @Override
   protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
   {
      Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
     
      try
      {
         // start the deployment
         ejb3Deployment.start();
      }
      catch (Exception e)
      {
         throw new DeploymentException("Error starting Ejb3Deployment: " + ejb3Deployment.getName(), e);
      }
   }
View Full Code Here

   }
  
   @Override
   public void undeploy(VFSDeploymentUnit unit, JBossMetaData metadata)
   {
      Ejb3Deployment deployment = unit.getAttachment(Ejb3Deployment.class);
      if(deployment == null)
         return;

      try
      {
         deployment.stop();
      }
      catch(Exception e)
      {
         log.warn("Failed to stop deployment " + deployment, e);
      }
      try
      {
         deployment.destroy();
      }
      catch(Exception e)
      {
         log.warn("Failed to destroy deployment " + deployment, e);
      }
View Full Code Here

      return false;
   }
  
   public void undeploy(VFSDeploymentUnit unit)
   {
      Ejb3Deployment deployment = unit.getAttachment(Ejb3Deployment.class);
      if (deployment == null) return;
      try
      {
         deployment.stop();
      }
      catch (Exception e)
      {
         log.error("failed to stop deployment", e);
      }
      try
      {
         deployment.destroy();
      }
      catch (Exception e)
      {
         log.error("failed to destroy deployment", e);
      }
View Full Code Here

   @Override
   protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException
   {
      final JBossMetaData mergedMD = (JBossMetaData) unit
            .getAttachment(MergedJBossMetaDataDeployer.EJB_MERGED_ATTACHMENT_NAME);
      final Ejb3Deployment ejb3Deployment = ASHelper.getOptionalAttachment(unit, Ejb3Deployment.class);

      if (mergedMD != null)
      {
         final WebServiceDeploymentAdapter wsDeploymentAdapter = new WebServiceDeploymentAdapter();
         final List<WebServiceDeclaration> endpoints = wsDeploymentAdapter.getServiceEndpoints();
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

         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

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.