Examples of WsResource


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

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

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

        EndpointReference memberEPR = null;
       
        while (i.hasNext() && memberEPR == null)
        {
            EndpointReference nextEPR = (EndpointReference)i.next();
            WsResource nextEntry = (WsResource)_entriesByMemberEPR.get(memberEPR);
           
            if (entry == nextEntry)
                memberEPR = nextEPR;
        }
       
View Full Code Here

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

            ScheduledTermination wsrl =
                (ScheduledTermination)resource.getCapability(WsrlConstants.SCHEDULED_TERMINATION_URI);
            termination = wsrl.getTerminationTime();
        }
       
        WsResource entry = addEntry(epr, null, termination);
       
        //
        // if we're using persistence, create a record of the entry
        //
        ServiceGroupPersistence persistence = (ServiceGroupPersistence)getPersistence();
       
        try
        {
            if (persistence != null)
                persistence.resourceAdded(entry.getEndpointReference(), entry);
        }
       
        catch (SoapFault fault)
        {
            throw new AddRefusedFault(fault);
View Full Code Here

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

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

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

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

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

           
            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

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

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

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

       
        //
        // create the resource to represent the pullpoint
        //
        String endpoint = getPullPointContextPath();
        WsResource pullPoint = null;
       
        try
        {
            pullPoint = (WsResource)manager.createResource(endpoint);
        }
       
        catch (SoapFault error)
        {
            throw new UnableToCreatePullPointFault(error);
        }
       
        EndpointReference epr = pullPoint.getEndpointReference();
       
        PullPoint pullPointCap = (PullPoint)pullPoint.getCapability(WsnConstants.PULL_POINT_URI);
        Filter filter = pullPointCap.getFilter();
       
        //
        // create subscription that will send messages to the pullpoint
        //
        NotificationProducer wsn = (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);
        WsResource sub = null;
       
        try
        {
            sub = wsn.subscribe(epr, filter, null, null);
        }
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.