Package org.apache.muse.ws.resource

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


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

    public void initialize()
        throws SoapFault
    {
        super.initialize();
       
        WsResource resource = getWsResource();
        ResourcePropertyCollection props = resource.getPropertyCollection();
        MetadataDescriptor metadata = props.getMetadata();
       
        //
        // load all of the metric data from the RMD
        //
View Full Code Here

        return _serviceGroup;
    }
   
    public EndpointReference getServiceGroupEPR()
    {
        WsResource sg = getServiceGroup();
        return sg == null ? null : sg.getEndpointReference();
    }
View Full Code Here

       
        //
        // find the entry resource, use the Entry capability to set the
        // member EPR and service group property values
        //
        WsResource entryResource = (WsResource)getResourceManager().getResource(entryEPR);       
        Entry entryCap = (Entry)entryResource.getCapability(WssgConstants.ENTRY_URI);
       
        WsResource sgResource = getServiceGroup();
       
        entryCap.setServiceGroup(sgResource);
        entryCap.setMemberEPR(memberEPR);
       
        ServiceGroup sgCap = (ServiceGroup)sgResource.getCapability(WssgConstants.SERVICE_GROUP_URI);
        sgCap.addEntry(memberEPR, entryResource);
       
        return entryResource;
    }
View Full Code Here

                               Element content,
                               Date termination)
        throws AddRefusedFault,
               BaseFault
    {
        WsResource entry = createEntry(memberEPR, content, termination);
        return addEntry(memberEPR, entry);
    }
View Full Code Here

        //
       
        if (epr == null)
            throw new NullPointerException(_MESSAGES.get("NullMemberServiceEPR"));
       
        WsResource sg = getWsResource();
       
        //
        // make sure this is a valid member of the group
        //
        if (!isMatch(epr))
            throw new AddRefusedFault(_MESSAGES.get("ContentCreationFailed"));

        ResourceManager manager = sg.getResourceManager();
        String endpoint = getEntryContextPath();
        WsResource resource = null;
       
        try
        {
            resource = (WsResource)manager.createResource(endpoint);
        }
       
        catch (SoapFault error)
        {
            throw new ResourceInitializationFault(error);
        }
       
        //
        // make sure the entry resource can process termination time, if
        // one exists. if it can't, the request was invalid.
        //
        // NOTE: we do NOT shutdown() the resource because it has not
        //       been initialize()d yet.       
        //
        if (termination != null && !resource.hasCapability(WsrlConstants.SCHEDULED_TERMINATION_URI))
        {
            Object[] filler = { endpoint, WsrlConstants.SCHEDULED_TERMINATION_URI };
            throw new AddRefusedFault(_MESSAGES.get("NoWSRL", filler));
        }
       
        //
        // set the sg entry fields before initializing the entry resource
        //
       
        Entry entry = (Entry)resource.getCapability(WssgConstants.ENTRY_URI);
       
        entry.setServiceGroup(sg);
        entry.setMemberEPR(epr);
       
        try
        {
            resource.initialize();
            manager.addResource(resource.getEndpointReference(), resource);
        }
       
        catch (SoapFault error)
        {
            throw new ResourceInitializationFault(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 (resource.hasCapability(WsrlConstants.SCHEDULED_TERMINATION_URI))
        {
            ScheduledTermination wsrl =
                (ScheduledTermination)resource.getCapability(WsrlConstants.SCHEDULED_TERMINATION_URI);
            wsrl.setTerminationTime(termination);
        }
       
        return resource;
    }
View Full Code Here

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

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

            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

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.