Package org.apache.muse.core.descriptor

Examples of org.apache.muse.core.descriptor.ResourceDefinition


    for (int n = 0; n < resourceXML.length; ++n) {
      OSGiResourceDescriptor rd = (OSGiResourceDescriptor) createResourceDescriptor();
      rd.setBundle(bundle);
      rd.load(resourceXML[n], env);

      ResourceDefinition definition = rd.getResourceDefinition();
      definitions.add(definition);
    }

    return definitions;
  }
View Full Code Here


      if(delegate != null){
        delegateMap.put(bundle, delegate);
        Iterator iter = resourceDefs.iterator();
        while(iter.hasNext()){
          ResourceDefinition def = (ResourceDefinition)iter.next();
          String contextPath = (String) bundle.getHeaders().get(
              OSGiPlatformConstants.MANAGEMENT_CONTEXT_HEADER);
          def.getContextPath();
          contextToBundleMap.put(contextPath + "/services/" + def.getContextPath(), bundle);
        }
      }
    } catch (Throwable t) {
      // Log the error somewhere
      t.printStackTrace();
View Full Code Here

                   
        Iterator i = definitions.iterator();
       
        while (i.hasNext())
        {
            ResourceDefinition definition = (ResourceDefinition)i.next();
            String endpoint = definition.getContextPath();
           
            //
            // sanity check - don't allow one component to over-write another
            //
            if (_definitionsByPath.containsKey(endpoint))
View Full Code Here

    }
   
    public Resource createResource(String contextPath)
        throws SoapFault
    {
        ResourceDefinition definition = getResourceDefinition(contextPath);
   
        if (definition == null)
        {
            Object[] filler = { contextPath, _definitionsByPath.keySet() };
            throw new SoapFault(_MESSAGES.get("ContextPathNotFound", filler));
        }
       
        Resource resource = definition.newInstance();
        resource.setResourceManager(this);
       
        fixContextPath(resource)// HACK: see javadoc for fixContextPath()
       
        return resource;
View Full Code Here

        //
        // make sure that required property value is used during
        // equality check of EPRs
        //
        String address = epr.getAddress().toString();
        ResourceDefinition definition = getResourceDefinition(address);
       
        if (definition == null)
            return null;
       
        return (Resource)_resources.get(epr);
View Full Code Here

        // for all distinct resource types...
        //
        while (i.hasNext())
        {
            String path = (String)i.next();
            ResourceDefinition resource = getResourceDefinition(path);
            Iterator j = resource.getCapabilityDefinitions().iterator();
           
            //
            // read through the capability definitions and try to
            // match the impl or interface class
            //
            while (j.hasNext())
            {
                CapabilityDefinition capability = (CapabilityDefinition)j.next();
                Class next = capability.getImplementationClass();
           
                if (capabilityClass.isAssignableFrom(next))
                    matches.add(resource.getContextPath());
            }
        }
       
        return matches;
    }
View Full Code Here

              
        Iterator i = definitions.iterator();
       
        while (i.hasNext())
        {
            ResourceDefinition next = (ResourceDefinition)i.next();
            String path = next.getContextPath();
            _definitionsByPath.remove(path);
        }
    }
View Full Code Here

        Collection definitions = getResourceDefinitions();
        Iterator i = definitions.iterator();
       
        while (i.hasNext())
        {
            ResourceDefinition next = (ResourceDefinition)i.next();
            next.setLog(log);
        }
       
        //
        // tell the resource manager about all our resource types
        //
View Full Code Here

                   
        Iterator i = definitions.iterator();
       
        while (i.hasNext())
        {
            ResourceDefinition definition = (ResourceDefinition)i.next();
            String endpoint = definition.getContextPath();
           
            //
            // sanity check - don't allow one component to over-write another
            //
            if (_definitionsByPath.containsKey(endpoint))
View Full Code Here

    }
   
    public Resource createResource(String contextPath)
        throws SoapFault
    {
        ResourceDefinition definition = getResourceDefinition(contextPath);
   
        if (definition == null)
        {
            Object[] filler = { contextPath, _definitionsByPath.keySet() };
            throw new SoapFault(_MESSAGES.get("ContextPathNotFound", filler));
        }
       
        Resource resource = definition.newInstance();
        resource.setResourceManager(this);
       
        fixContextPath(resource)// HACK: see javadoc for fixContextPath()
       
        return resource;
View Full Code Here

TOP

Related Classes of org.apache.muse.core.descriptor.ResourceDefinition

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.