Package org.apache.muse.core.platform.osgi.descriptor

Examples of org.apache.muse.core.platform.osgi.descriptor.OSGiDeploymentDescriptor


   * @return an <code>OSGiDeploymentDescritpor</code> instance.
   *
   * @see OSGiDeploymentDescriptor
   */
  protected DeploymentDescriptor createDeploymentDescriptor() {
    return new OSGiDeploymentDescriptor();
  }
View Full Code Here


    OSGiEnvironment env = new OSGiEnvironmentImpl(false);
    env.setThreadLocalBundle(bundle);
    OSGiReflectUtilHelper.getDefault().setThreadLocalBundle(bundle);
    try {
      Document ddXML = env.getDocument(target);
      OSGiDeploymentDescriptor dd = new OSGiDeploymentDescriptor();
      Collection resourceDefs = dd.loadContextPaths(ddXML, env);
      Iterator paths = resourceDefs.iterator();
     
      String contextPath = (String) bundle.getHeaders().get(
          OSGiPlatformConstants.MANAGEMENT_CONTEXT_HEADER);
      while (paths.hasNext()) {
        String context = (String) paths.next();
        String wsdlPath = dd.getWsdlPathForContext(ddXML, context);
        //FIXME - this will work for Axis - not sure about others
        contextToBundleMap.put(contextPath + "/services/" + context, bundle);
        list.add(new ContextInfo(context, wsdlPath));
      }
View Full Code Here

  }
 
  protected void addResourceDefinitions(Bundle bundle, URL resourceConfig) {

    OSGiDeploymentDescriptor dd = new OSGiDeploymentDescriptor();

    Document ddXML = getDocument(bundle, resourceConfig);
    if (ddXML == null)
      return;
    try {
      dd.setBundle(bundle);
      dd.load(ddXML, this.getEnvironment());

      //
      // put all custom serializers in the serializer registry
      //
      Collection serializerDefinitions = dd.getSerializerDefinitions();
      Iterator i = serializerDefinitions.iterator();

      SerializerRegistry registry = SerializerRegistry.getInstance();

      while (i.hasNext()) {
        SerializerDefinition next = (SerializerDefinition) i.next();

        Serializer ser = next.create();
        Class type = ser.getSerializableType();

        Class arrayType = ReflectUtils.getArrayClassFromClass(type);
        Serializer arraySer = new ArraySerializer(arrayType, ser);

        registry.registerSerializer(type, ser);
        registry.registerSerializer(arrayType, arraySer);
      }

      //
      // check for any specified router - this may be used
      // as a delegate when trying to resolve a reference
      // to a resource
      //
      RouterDefinition rd = dd.getRouterDefinition();
      Class delegateRouter = rd.getRouterClass();
      ResourceRouter delegate = null;
     
      //initialize persistence for router
      PersistenceDefinition persistenceDef = rd.getPersistenceDefinition();
      if(delegateRouter != null){
        delegate = rd.newInstance();
     
        if(persistenceDef != null){
                RouterPersistence persistence = (RouterPersistence)persistenceDef.newInstance();
                delegate.setPersistence(persistence);
        }       
        delegate.initialize();
      }

      Collection resourceDefs = dd.getResourceDefinitions();

      this.addResourceDefinitions(bundle, resourceDefs);

      if(delegate != null){
        delegateMap.put(bundle, delegate);
View Full Code Here

   * @return an <code>OSGiDeploymentDescritpor</code> instance.
   *
   * @see OSGiDeploymentDescriptor
   */
  protected DeploymentDescriptor createDeploymentDescriptor() {
    return new OSGiDeploymentDescriptor();
  }
View Full Code Here

    OSGiEnvironment env = new OSGiEnvironmentImpl(false);
    env.setThreadLocalBundle(bundle);
    OSGiReflectUtilHelper.getDefault().setThreadLocalBundle(bundle);
    try {
      Document ddXML = env.getDocument(target);
      OSGiDeploymentDescriptor dd = new OSGiDeploymentDescriptor();
      Collection resourceDefs = dd.loadContextPaths(ddXML, env);
      Iterator paths = resourceDefs.iterator();
     
      String contextPath = (String) bundle.getHeaders().get(
          OSGiPlatformConstants.MANAGEMENT_CONTEXT_HEADER);
      while (paths.hasNext()) {
        String context = (String) paths.next();
        String wsdlPath = dd.getWsdlPathForContext(ddXML, context);
        //FIXME - this will work for Axis - not sure about others
        contextToBundleMap.put(contextPath + "/services/" + context, bundle);
        list.add(new ContextInfo(context, wsdlPath));
      }
View Full Code Here

  }
 
  protected void addResourceDefinitions(Bundle bundle, URL resourceConfig) {

    OSGiDeploymentDescriptor dd = new OSGiDeploymentDescriptor();

    Document ddXML = getDocument(bundle, resourceConfig);
    if (ddXML == null)
      return;
    try {
      dd.setBundle(bundle);
      dd.load(ddXML, this.getEnvironment());

      //
      // put all custom serializers in the serializer registry
      //
      Collection serializerDefinitions = dd.getSerializerDefinitions();
      Iterator i = serializerDefinitions.iterator();

      SerializerRegistry registry = SerializerRegistry.getInstance();

      while (i.hasNext()) {
        SerializerDefinition next = (SerializerDefinition) i.next();

        Serializer ser = next.create();
        Class type = ser.getSerializableType();

        Class arrayType = ReflectUtils.getArrayClassFromClass(type);
        Serializer arraySer = new ArraySerializer(arrayType, ser);

        registry.registerSerializer(type, ser);
        registry.registerSerializer(arrayType, arraySer);
      }

      //
      // check for any specified router - this may be used
      // as a delegate when trying to resolve a reference
      // to a resource
      //
      RouterDefinition rd = dd.getRouterDefinition();
      Class delegateRouter = rd.getRouterClass();
      ResourceRouter delegate = null;
     
      //initialize persistence for router
      PersistenceDefinition persistenceDef = rd.getPersistenceDefinition();
      if(delegateRouter != null){
        delegate = rd.newInstance();
     
        if(persistenceDef != null){
                RouterPersistence persistence = (RouterPersistence)persistenceDef.newInstance();
                delegate.setPersistence(persistence);
        }       
        delegate.initialize();
      }

      Collection resourceDefs = dd.getResourceDefinitions();

      this.addResourceDefinitions(bundle, resourceDefs);

      if(delegate != null){
        delegateMap.put(bundle, delegate);
View Full Code Here

   * @return an <code>OSGiDeploymentDescritpor</code> instance.
   *
   * @see OSGiDeploymentDescriptor
   */
  protected DeploymentDescriptor createDeploymentDescriptor() {
    return new OSGiDeploymentDescriptor();
  }
View Full Code Here

TOP

Related Classes of org.apache.muse.core.platform.osgi.descriptor.OSGiDeploymentDescriptor

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.