Package org.jboss.deployment.spi

Examples of org.jboss.deployment.spi.EndpointInfo


      // the alternate mapping (See MappedReferenceMetaDataResolverDeployer.mapEjbs)
      endpointAlternateMap.put("ejb/Ejb1InJar1", "ejb/ejb1.jar#Ejb1InJar1");
      endpointAlternateMap.put("ejb/Ejb2InJar1", "ejb/ejb1.jar#Ejb2InJar1");
      // A business-local mapping for Ejb1InJar1
      endpointAlternateMap.put("ejb/ejb1.jar@"+EjbLinkIF.class.getName(), "ejb/ejb1.jar#Ejb1InJar1");
      EndpointInfo info = resolver.getEndpointInfo("Ejb1InJar1", EndpointType.EJB, "ejb1.jar");
      assertNotNull(info);
      assertEquals("Ejb1InJar1", info.getName());
      assertEquals("ejb1.jar", info.getPathName());

      info = resolver.getEndpointInfo("../ejb1.jar#Ejb2InJar1", EndpointType.EJB, "ejb2.jar");
      assertNotNull(info);
      assertEquals("Ejb2InJar1", info.getName());
      assertEquals("ejb1.jar", info.getPathName());

      //
      info = resolver.getEndpointInfo(EjbLinkIF.class, EndpointType.EJB, "ejb1.jar");
      assertNotNull(info);
      assertEquals("Ejb1InJar1", info.getName());
      assertEquals("ejb1.jar", info.getPathName());
     
      // Test finding a bean with only a bean name
      info = resolver.getEndpointInfo("Ejb2InJar1", EndpointType.EJB, "ejb2.jar");
      assertNotNull(info);
      assertEquals("Ejb2InJar1", info.getName());
      assertEquals("ejb1.jar", info.getPathName());
   }
View Full Code Here


         // TODO: EJBTHREE-1291
         return ejbRefResolver.getEjbContainer(businessIntf);
      }

      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);
         }
View Full Code Here

         return ejbRefResolver.getEjbContainer(ejbLink, businessIntf);
      }

      EJBContainer container = null;
      // 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);
         }
View Full Code Here

      {
         // Look for a top level binding
         altKey = "ejb@"  + businessIntf.getName();
         key = this.endpointAlternateMap.get(altKey);
      }
      EndpointInfo info = null;
      if(key != null)
      {
         ContainerDependencyMetaData cdmd = endpointMap.get(key);
         info = new EndpointInfo(cdmd.getDeploymentPath(), cdmd.getComponentName(), type);
      }
      return info;
   }
View Full Code Here

         //
         // Get the endpoint name
         endpointName = ref.substring(ref.indexOf('#') + 1);
      }

      EndpointInfo info = null;
      String key = prefix + "/" + unitPath +"#" + endpointName;
      ContainerDependencyMetaData cdmd = endpointMap.get(key);
      if(cdmd != null)
      {
         info = new EndpointInfo(unitPath, endpointName, type);
         return info;
      }
     
      // It could not be found in the unit itself, let's search globally
      if(ref.indexOf('#') == -1)
      {
         // See MappedReferenceMetaDataResolverDeployer.mapEjbs
         if(type.equals(EndpointType.EJB))
         {
            key = "ejb/" + ref;
         }
         else if(type.equals(EndpointType.MessageDestination))
         {
            key = "message-destination/" + ref;           
         }

         String ejbCompID = endpointAlternateMap.get(key);
         if(ejbCompID != null)
         {
            cdmd = endpointMap.get(ejbCompID);
            if(cdmd == null)
               throw new IllegalStateException("endpoint mapping is corrupt, can't find '" + ejbCompID + "' in " + endpointMap);
            info = new EndpointInfo(cdmd.getDeploymentPath(), cdmd.getComponentName(), type);
            return info;
         }
      }
      else
      {
View Full Code Here

            if(ref.mappedName().length() > 0)
               mappedName = ref.mappedName();
           
            if(mappedName == null)
            {
               EndpointInfo info = null;
               String link = null;
              
               if(ref.beanName().length() > 0)
                  link = ref.beanName();
              
               if(link != null)
                  info = resolver.getEndpointInfo(link, EndpointType.EJB, vfsContext);
               if(info == null)
                  info = resolver.getEndpointInfo(field.getType(), EndpointType.EJB, vfsContext);
               if(info == null)
                  throw new IllegalStateException("No mapped-name for field: "+field+", "+ref);

               ContainerDependencyMetaData cdmd = endpoints.get(info.getComponentKey());
               if(cdmd == null)
                  throw new IllegalStateException("Failed to resolve ContainerDependencyMetaData for info: "+info+", "+ref);
                mappedName = cdmd.getContainerName();
            }
           
View Full Code Here

      String vfsContext = unit.getRelativePath();
      for(AnnotatedEJBReferenceMetaData ref : annotatedRefs)
      {
         Class iface = ref.getBeanInterface();
         String link = ref.getLink();
         EndpointInfo info = null;
         if(link != null)
            info = resolver.getEndpointInfo(link, EndpointType.EJB, vfsContext);
         if(info == null && iface != null)
            info = resolver.getEndpointInfo(iface, EndpointType.EJB, vfsContext);

         if(info != null)
         {
            ContainerDependencyMetaData target = endpointMap.get(info.getComponentKey());
            if(target != null)
            {
               cdmd.addDependency(target);
               // Determine the jndi name for the reference interface
               String ifaceName = iface != null ? iface.getName() : null;
View Full Code Here

         if(mappedName == null || mappedName.length() == 0)
         {
            ContainerDependencyMetaData target = null;
            if(link != null)
            {
               EndpointInfo info = resolver.getEndpointInfo(link, EndpointType.EJB, vfsContext);
               if(info != null)
               {
                  target = endpointMap.get(info.getComponentKey());
               }
               else
               {
                  /* A non-local link without a # jar target. This is allowed
                     for java ee clients so we have to search all ejb deployments.
                     First get the vfspaths of the ejb deploymens.
                  */
                  List<String> ejbPaths = getEjbDeploymentPaths(unit);
                  for(String path : ejbPaths)
                  {
                     EndpointInfo altInfo = resolver.getEndpointInfo(link, EndpointType.EJB, path);
                     if(altInfo != null)
                        target = endpointMap.get(altInfo.getComponentKey());
                     if(target != null)
                        break;
                  }
               }
            }
View Full Code Here

         if(mappedName == null || mappedName.length() == 0)
         {
            ContainerDependencyMetaData target = null;
            if(link != null)
            {
               EndpointInfo info = resolver.getEndpointInfo(link, EndpointType.EJB, vfsContext);
               if(info != null)
               {
                  target = endpointMap.get(info.getComponentKey());
               }
               else
               {
                  /* A non-local link without a # jar target. This is allowed
                     for java ee clients so we have to search all ejb deployments.
                     First get the vfspaths of the ejb deploymens.
                  */
                  List<String> ejbPaths = getEjbDeploymentPaths(unit);
                  for(String path : ejbPaths)
                  {
                     EndpointInfo altInfo = resolver.getEndpointInfo(link, EndpointType.EJB, path);
                     if(altInfo != null)
                        target = endpointMap.get(altInfo.getComponentKey());
                     if(target != null)
                        break;
                  }
               }
               if(target == null)
View Full Code Here

         {
            String link = ref.getLink();
            ContainerDependencyMetaData target = null;
            if(link != null)
            {
               EndpointInfo info = resolver.getEndpointInfo(link, EndpointType.MessageDestination, vfsContext);
               if(info != null)
               {
                  target = endpointMap.get(info.getComponentKey());
               }
            }
            if(target == null)
               unresolvedRefs.add(cdmd.getComponentID()+":"+ref);
            else
View Full Code Here

TOP

Related Classes of org.jboss.deployment.spi.EndpointInfo

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.