_resourceManager.setEnvironment(env); _resourceManager.addResourceDefinitions(definitions); _resourceManager.addListener(persistence); _resourceManager.initialize();
String address = manager.getEnvironment().getDefaultURI(); int lastSlash = address.lastIndexOf('/'); address = address.substring(0, lastSlash + 1) + contextPath; Resource resource = manager.createResource(contextPath); resource.setEndpointReference(epr); manager.addResource(epr, resource);
Resource resource = manager.getResource(epr); List<String> availableBaseEPRs = resolveAvailableBaseEPRs(manager, manager.getResourceContextPaths()); if (!availableBaseEPRs.contains(requestSpecifiedAddress)) {
pullPoint = (WsResource)manager.createResource(endpoint); manager.addResource(epr, pullPoint);
_subscriptionPath = manager.getResourceContextPath(SubscriptionManager.class); manager.addListener(this);
if (manager.getResource(_epr) != null) manager.removeResource(_epr);
public void initializeCompleted() throws SoapFault { super.initializeCompleted(); Resource resource = getResource(); // // this allows the advertisement capability to hear about // all resource lifecycle events that happen in the application // ResourceManager manager = resource.getResourceManager(); manager.addListener(this); // // initialize the advertisement topics // NotificationProducer wsn = (NotificationProducer)resource.getCapability(WsnConstants.PRODUCER_URI); wsn.addTopic(MuwsConstants.ADV_ME_CREATION_TOPIC); wsn.addTopic(MuwsConstants.ADV_ME_DESTRUCTION_TOPIC); // // create subscriptions for all event consumer that are going to // receive notifications from the above topics // subscribeInitialConsumer(); }
WsResource entryResource = (WsResource)getResourceManager().getResource(entryEPR); Entry entryCap = (Entry)entryResource.getCapability(WssgConstants.ENTRY_URI);
public void resourceRemoved(EndpointReference epr) throws SoapFault { if (!isAdvertised(epr)) return; Element payload = XmlUtils.createElement(MuwsConstants.DESTROY_NOTIFICATION_QNAME); sendMessage(epr, MuwsConstants.ADV_ME_DESTRUCTION_TOPIC, WefConstants.DESTROY_SITUATION_QNAME, payload); Resource advertiser = getResource(); if (advertiser.hasBeenShutdown()) advertiser.getResourceManager().removeListener(this); }
public void initialize() throws SoapFault { super.initialize(); // // find pullpoint resource type so we can create instances of it // in createPullPoint() // ResourceManager manager = getResource().getResourceManager(); _pullPointPath = manager.getResourceContextPath(PullPoint.class); if (_pullPointPath == null) throw new RuntimeException("No PullPoint endpoint deployed"); } }
resource = (WsResource)manager.createResource(endpoint); manager.addResource(resource.getEndpointReference(), resource);
ResourceManager manager = resource.getResourceManager(); _entryPath = manager.getResourceContextPath(Entry.class); manager.addListener(this);
WsResource subResource = (WsResource)getResourceManager().getResource(subEPR); SubscriptionManager sub = (SubscriptionManager)subResource.getCapability(WsnConstants.SUBSCRIPTION_MGR_URI);
public void resourceRemoved(EndpointReference epr) { // // if the SG is destroyed, it means we're being told about // our own destruction - don't do anything // 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) // or a member that was removed by a remote client before // the member was destroyed // if (entry != null) removeEntry(entry); } }
sub = (WsResource)manager.createResource(endpoint); manager.addResource(sub.getEndpointReference(), sub);