/** * * @return The EPR of the resource receiving requests. This is the same * value returned by getDestination(). * */ public EndpointReference getEndpointReference() { return getDestination(); }
/** * * @param fileNumber * * @return A string of the following format: {file-prefix}{file-number}.xml * */ protected String getNextFileName(int fileNumber) { return getFilePrefix() + fileNumber + ".xml"; }
public void initializeCompleted() throws SoapFault { Persistence persistence = getPersistence(); // // if the capability defines a persistence mechanism, we // should ask it to reload any saved data // if (persistence != null) { ResourceManager manager = getResource().getResourceManager(); persistence.setResourceManager(manager); persistence.reload(); } }
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); }
/** * * This implementation checks to see if the resource type is one that * is being persisted, and if so, creates a file for the instance. * */ public void resourceAdded(EndpointReference epr, Resource resource) throws SoapFault { String contextPath = resource.getContextPath(); if (getResourceManager().isUsingPersistence(contextPath)) createResourceFile(epr, resource); }
/** * * @return The File directory that was specified as the persistence location * in muse.xml. The directory may not exist, so use File.exists() * and/or File.mkdirs() to prevent I/O errors. * */ protected File getPersistenceDirectory() { String path = getPersistenceLocation(); if (path == null) throw new RuntimeException(_MESSAGES.get("NoPersistenceLocation")); File workingDir = getResourceManager().getEnvironment().getRealDirectory(); return new File(workingDir, path); }
public void initialize() throws SoapFault { super.initialize(); setMessageHandler(createGetMetadataHandler()); } }
public void setTraceWriter(PrintWriter writer) { getSoapClient().setTraceWriter(writer); }
/** * * This method can be overridden to provide an alternate implementation * of the ResourceManager component to the router. * * @return An instance of SimpleResourceManager. * */ protected ResourceManager createResourceManager() { return new SimpleResourceManager(); }
public final boolean hasCapability(String capabilityURI) { return getCapability(capabilityURI) != null; }
/** * * This is a convenience method that uses the given ProxyHandler to * serialize the parameters (and deserialize the response) before * calling invoke(String, Element). * * @see #invoke(String, Element) * */ public Object invoke(ProxyHandler handler, Object[] parameters) throws SoapFault { return invoke(handler, parameters, new Element[0]); }
/** * * This is a convenience constructor that calls * this(EndpointReference, EndpointReference, SoapClient) with * the SoapClient provided by the given Environment. * * @see #AbstractResourceClient(EndpointReference, EndpointReference, SoapClient) * @see Environment#getSoapClient() * */ public AbstractResourceClient(EndpointReference destination, EndpointReference source, Environment environment) { this(destination, source, environment.getSoapClient()); }
/** * * @param classLoader * The ClassLoader that will be used to load all Java classes as well * as all file system resources. * * @param createSoapClient * True if you want the SOAP client to be initialized. This requires * that you have a valid JAX-RPC SOAP implementation (not just the * interfaces) on the classpath. * */ public AbstractEnvironment(ClassLoader classLoader, boolean createSoapClient) { initialize(classLoader, createSoapClient); }
/** * adds resource definitions to the manager. If the collection is * empty or null, no action is taken * @param definitions the collection of resource definitions to be added to the manager */ public void addResourceDefinitions(Collection definitions) { if(definitions == null || definitions.isEmpty()) return; super.addResourceDefinitions(definitions); }
public String createRelativePath(String originalPath, String relativePath) { URI original = URI.create(originalPath); // // If the relative path is an absolute path // then it only makes sense to return it since returning a absolute // path relative to another path does not make sense // if(isAbsolute(relativePath)) { return relativePath; } return original.resolve(relativePath).toString(); }
/** * * @return The resource's EPR, in string form. * */ public String toString() { return getEndpointReference().toString(); } }
public void stopSoapMonitor() { getSoapClient().stopSoapMonitor(); } }
public int getSoapMonitorPort() { return getSoapClient().getSoapMonitorPort(); }
public boolean isUsingSoapMonitor() { return getSoapClient().isUsingSoapMonitor(); }
public boolean isUsingTrace() { return getSoapClient().isUsingTrace(); }