Examples of WsResource


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

    }
   
    public Element toXML(Object result)
        throws SoapFault
    {
        WsResource sub = (WsResource)result;
       
        //
        // add termination time to the response, if it exists
        //
        ScheduledTermination wsrl = (ScheduledTermination)sub.getCapability(WsrlConstants.SCHEDULED_TERMINATION_URI);
        Date time = null;
       
        if (wsrl != null)
            time = wsrl.getTerminationTime();
       
View Full Code Here

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

       
        //
        // 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

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

    public WsResource addRelationship(String name,
                                      RelationshipType type,
                                      Participant[] participants)
        throws BaseFault
    {
        WsResource relationship = createRelationship(name, type, participants);
        _relationships.add(relationship);
        return relationship;
    }
View Full Code Here

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

       
        //
        // 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);
           
            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);
               
        //
        // read all of the wsnt:TopicExpression values from the RMD doc
        // and make sure we create Topic objects for them
View Full Code Here

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

        String endpoint = getRelationshipContextPath();
       
        //
        // first create an empty instance of the relationship type
        //
        WsResource resource = null;
       
        try
        {
            resource = (WsResource)manager.createResource(endpoint);
        }
       
        catch (SoapFault error)
        {
            throw new RelationshipCreationFailedFault(error);
        }
       
        //
        // use the relationship capability to set the fields before initializing
        //
        RelationshipResource relationship =
            (RelationshipResource)resource.getCapability(MuwsConstants.RELATIONSHIP_RESOURCE_URI);
       
        relationship.setName(name);
        relationship.setType(type);
        relationship.setParticipant(participants);
       
        try
        {
            resource.initialize();
            manager.addResource(resource.getEndpointReference(), resource);
        }
       
        catch (SoapFault error)
        {
            throw new RelationshipCreationFailedFault(error);
View Full Code Here

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

        {
            ProducerPropertiesFilter propertiesFilter = (ProducerPropertiesFilter)filter;
            propertiesFilter.setResource(getWsResource());
        }
       
        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);
            }
           
            catch (BaseFault error)
            {
                throw new UnacceptableInitialTerminationTimeFault(error);
            }
        }
       
        addSubscription(sub);
       
        NotificationProducerPersistence persistence = (NotificationProducerPersistence)getPersistence();
       
        try
        {
            if (persistence != null)
                persistence.resourceAdded(sub.getEndpointReference(), sub);
        }
       
        catch (SoapFault fault)
        {
            LoggingUtils.logError(getLog(), fault);
View Full Code Here

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

       
        //
        // make sure the RelationshipResource endpoint is exposed, since our
        // relationships are all first-class resources
        //
        WsResource resource = getWsResource();
       
        ResourceManager manager = resource.getResourceManager();
        _relationshipPath = manager.getResourceContextPath(RelationshipResource.class);
       
        if (_relationshipPath == null)
            throw new RuntimeException(_MESSAGES.get("NoRelationshipEndpoint"));
       
View Full Code Here

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

        throws AddRefusedFault,
               ContentCreationFailedFault,
               UnsupportedMemberInterfaceFault,
               BaseFault
    {
        WsResource entry = getServiceGroup().addEntry(memberEPR, content, terminationTime);
        return entry.getEndpointReference();
    }
View Full Code Here

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

{
    public Element[] getMetadata(String dialect)
    {
        if (dialect != null && dialect.equals(WsrmdConstants.NAMESPACE_URI))
        {
            WsResource resource = (WsResource)getResource();
            MetadataDescriptor rmd = resource.getPropertyCollection().getMetadata();
            return new Element[]{ rmd.toXML() };
        }
       
        return super.getMetadata(dialect);
    }
View Full Code Here

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

        super.initializeCompleted();
       
        //
        // add the capability URI to the ManageabilityCharacteristics list
        //
        WsResource resource = getWsResource();
        ManageabilityCharacteristics mc =
            (ManageabilityCharacteristics)resource.getCapability(MuwsConstants.CHARACTERISTICS_URI);
       
        if (mc != null)
            mc.addManageabilityCapability(getCapabilityURI());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.