Package org.apache.muse.ws.resource

Examples of org.apache.muse.ws.resource.WsResource


        if (hasBeenShutdown())
            getWsResource().getResourceManager().removeListener(this);
       
        else
        {
            WsResource entry = getEntry(epr);
           
            //
            // if there was no value in the SG for the EPR, it was
            // either a wssg:Entry resource (entries do not have
            // entries themselves, or we'd have infinite recursion)
View Full Code Here


       
        //
        // find the subscription resource, use the SubscriptionManager capability
        // to set property values
        //
        WsResource subResource = (WsResource)getResourceManager().getResource(subEPR);
        SubscriptionManager sub = (SubscriptionManager)subResource.getCapability(WsnConstants.SUBSCRIPTION_MGR_URI);
       
        sub.setConsumerReference(consumerEPR);
        sub.setProducerReference(producerEPR);
        sub.setFilter(filter);
       
View Full Code Here

      return;
    }
    ManagementResourceRouter router = (ManagementResourceRouter)_router;
    //make an EPR
    try {
      WsResource resource = (WsResource)router.addNewResource(contribution);
      resourceForContribution.put(contribution, resource);
      if(contribution instanceof BundleContribution){
        handleBundleDependencies((BundleContribution)contribution, resource);
      } else if(contribution instanceof ServiceContribution){
        handleServiceRelationships((ServiceContribution)contribution, resource);
View Full Code Here

      }
      BundleContribution[] dependencies = contribution.getBundleDependents();
      if(dependencies == null) return;
      for(int i=0;i<dependencies.length;i++){
        BundleContribution dependency = dependencies[i];
        WsResource targetResource = (WsResource)resourceForContribution.get(dependency);
        if(targetResource == null){
          continue;
        }
        Participant[] participants = new Participant[2];
        QName typeNames[] = {new QName("http://resource.management.osgi/Bundle","Requires","osgi")};
View Full Code Here

      Relationships relCap = (Relationships)resource.getCapability(MuwsConstants.RELATIONSHIPS_URI);
      if(relCap == null) return;

      BundleContribution provider = contribution.getServiceProvider();
      if(provider != null){
        WsResource targetResource = (WsResource)resourceForContribution.get(provider);
        if(targetResource != null){
          Participant[] participants = new Participant[2];
          QName typeNames[] = {new QName("http://resource.management.osgi/Service","ServiceProvider","osgi")};
          RelationshipType type = new SimpleRelationshipType(typeNames);
          participants[0] = new SimpleParticipant(resource, "service");
          participants[1] = new SimpleParticipant(targetResource, "provider");
          relCap.addRelationship("ServiceConsumer", type, participants);

          //Now add reciprocal relationship to the bundle resource
          relCap = (Relationships)targetResource.getCapability(MuwsConstants.RELATIONSHIPS_URI);
          participants = new Participant[2];
          QName serviceTypeNames[] = {new QName("http://resource.management.osgi/Bundle","RegisteredService","osgi")};
          type = new SimpleRelationshipType(serviceTypeNames);
          participants[0] = new SimpleParticipant(resource, "service");
          participants[1] = new SimpleParticipant(targetResource, "provider");
          relCap.addRelationship("RegisteredService", type, participants);
        }
      }

      BundleContribution[] consumers = contribution.getServiceConsumers();
      if(consumers == null) return;
      for(int i=0;i<consumers.length;i++){
        BundleContribution dependency = consumers[i];
        WsResource targetResource = (WsResource)resourceForContribution.get(dependency);
        if(targetResource == null){
          continue;
        }
        Participant[] participants = new Participant[2];
        QName typeNames[] = {new QName("http://resource.management.osgi/Service","ServiceConsumer")};
View Full Code Here

      }
      return;
    }
    ManagementResourceRouter router = (ManagementResourceRouter)_router;
    try {
      WsResource resource = (WsResource)resourceForContribution.get(contribution);
      if(resource != null){
        resource.shutdown();
      }
    } catch (SoapFault e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

   *
   * @return the resource metadata descriptor.
   */
  protected Element getResourceMetadataDescriptor()
  {
        WsResource resource = (WsResource)getResource();
        MetadataDescriptor metadataDescriptor = resource.getPropertyCollection().getMetadata();
        return metadataDescriptor.toXML();   
  }
View Full Code Here

       
        //
        // make sure we're exposing the subscription endpoint so that
        // clients can manage subscriptions/consumers
        //
        WsResource resource = getWsResource();
        ResourceManager manager = resource.getResourceManager();
        _subscriptionPath = manager.getResourceContextPath(SubscriptionManager.class);

        if (_subscriptionPath == null)
            throw new RuntimeException(_MESSAGES.get("NoSubscriptionManager"));
       
View Full Code Here

       
        //
        // for every property in the resource's ws-rp doc, create a property
        // change listener that will send out notifications for each change
        //
        WsResource resource = getWsResource();
        ResourcePropertyCollection props = resource.getPropertyCollection();
        Iterator i = props.getPropertyNames().iterator();
       
        while (i.hasNext())
        {
            QName name = (QName)i.next();
           
            addTopic(name);
            _allTopicNames.add(name);
           
            PropertyChangeListener listener = factory.newInstance(name, resource);
            props.addChangeListener(listener);
        }
       
        //
        // if the resource supports either WS-RL capability, add support
        // for the WS-RL termination topic
        //
        if (resource.hasCapability(WsrlConstants.IMMEDIATE_TERMINATION_URI) ||
            resource.hasCapability(WsrlConstants.SCHEDULED_TERMINATION_URI))
        {
            addTopic(WsrlConstants.TERMINATION_TOPIC_QNAME);
            _allTopicNames.add(WsrlConstants.TERMINATION_TOPIC_QNAME);
        }
    }
View Full Code Here

           
            if (!hasTopic(topic))
                throw new TopicNotSupportedFault("Topic not found: " + topic);
        }
       
        WsResource producer = getWsResource();
        ResourceManager manager = producer.getResourceManager();
       
        //
        // create the resource to represent the subscription
        //
        String endpoint = getSubscriptionContextPath();
        WsResource sub = null;
       
        try
        {
            sub = (WsResource)manager.createResource(endpoint);
        }
       
        catch (SoapFault error)
        {
            throw new SubscribeCreationFailedFault(error);
        }
       
        //
        // use the subscription capability to set all the subscription fields
        //
        SubscriptionManager subMgr =
            (SubscriptionManager)sub.getCapability(WsnConstants.SUBSCRIPTION_MGR_URI);
       
        EndpointReference producerEPR = producer.getEndpointReference();
        subMgr.setProducerReference(producerEPR);
       
        subMgr.setConsumerReference(consumer);
        subMgr.setFilter(filter);
        subMgr.setSubscriptionPolicy(policy);
       
        try
        {
            sub.initialize();
            manager.addResource(sub.getEndpointReference(), sub);
        }
       
        catch (SoapFault error)
        {
            throw new SubscribeCreationFailedFault(error);           
        }
       
        //
        // set termination time AFTER we initialize so that we can rely
        // on the base Resource class' implementation of WS-RL (which
        // tries to apply the change immediately, rather than storing it
        // in a field and setting it during initialization)
        //
        if (sub.hasCapability(WsrlConstants.SCHEDULED_TERMINATION_URI))
        {
            ScheduledTermination wsrl = (ScheduledTermination)sub.getCapability(WsrlConstants.SCHEDULED_TERMINATION_URI);
           
            try
            {
                wsrl.setTerminationTime(terminationTime);
            }
View Full Code Here

TOP

Related Classes of org.apache.muse.ws.resource.WsResource

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.