protected MessageHandler createMessageHandler(String actionURI, QName operationName, QName returnValueName) { return new ReflectionMessageHandler(actionURI, operationName, returnValueName); }
public void shutdown() throws SoapFault { _router.shutdown(); _router = null; _hasBeenShutdown = true; } }
/** * * This implementation checks to see if the resource type is one that * is being persisted, and if so, tries to delete the resource's file. * */ public void resourceRemoved(EndpointReference epr) throws SoapFault { String contextPath = getContextPath(epr); if (getResourceManager().isUsingPersistence(contextPath)) destroyResourceFile(epr); } }
protected MessageHandler createQueryHandler() { MessageHandler handler = new QueryHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "queryResourceProperties"); handler.setMethod(method); return handler; }
public Element invoke(Element soapBody){ Resource resource = null; try { Bundle bundle = getDelegateBundle(); ResourceRouter delegateRouter = null; if(bundle != null){ delegateRouter = (ResourceRouter)delegateMap.get(bundle); } ((OSGiEnvironment)getEnvironment()).setThreadLocalBundle(bundle); return delegateRouter.invoke(soapBody); } finally { ((OSGiEnvironment)getEnvironment()).setThreadLocalBundle(null); } }
protected Resource getTargetResource() throws SoapFault { try { return super.getTargetResource(); } catch (SoapFault error) { throw new ResourceUnknownFault(error); } } }
/** * * 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); }
/** * * {@inheritDoc} * <br><br> * This implementation iterates over the collection of resources in * the ResourceManager and destroys each one. If one destructor fails, * it is logged and we move on to the next resource. * * @see #getResourceManager() * */ public void shutdown() { try { getResourceManager().shutdown(); } catch (SoapFault error) { LoggingUtils.logError(getLog(), error); } _hasBeenShutdown = true; } }
protected void setMessageHandler(MessageHandler handler) { _handlersByAction.put(handler.getAction(), handler); }
/** * * Creates the QName that will be used to package up all objects that * are serialized to XML with toXML(Object). The default behavior is * to take the local part of the request QName and add the "Response" * suffix to it. Thus, CreatePurchase becomes CreatePurchaseResponse. * Users can override this method to change the response name. * * @return A QName that is just like the request QName, but with the * "Response" suffix added to the end of the local part. * * @see #getRequestName() * @see #getResponseName() * */ private QName createResponseName() { QName request = getRequestName(); String uri = request.getNamespaceURI(); String name = request.getLocalPart(); String prefix = request.getPrefix(); return new QName(uri, name + "Response", prefix); }
/** * * @param actionURI * The WS-A Action URI this handler is used for. * * @param requestQName * The QName of the element that wraps parameters for incoming messages. * */ protected AbstractMessageHandler(String actionURI, QName requestQName) { if (actionURI == null) throw new NullPointerException(_MESSAGES.get("NullAction")); _actionURI = actionURI; _requestQName = requestQName; if (_requestQName != null) _responseQName = createResponseName(); }
protected MessageHandler createSetTerminationTimeHandler() { MessageHandler handler = new SetTerminationTimeHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "setTerminationTime"); handler.setMethod(method); return handler; }
public Element invoke(Element soapBody) { Resource resource = null; try { resource = getTargetResource(); } catch (SoapFault fault) { return fault.toXML(); } return resource.invoke(soapBody); }
protected MessageHandler createGetCurrentMessageHandler() { MessageHandler handler = new GetCurrentMessageHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "getCurrentMessage"); handler.setMethod(method); return handler; }
protected MessageHandler createSetHandler() { MessageHandler handler = new SetHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "setResourceProperties"); handler.setMethod(method); return handler; }
protected MessageHandler createGetDocumentHandler() { MessageHandler handler = new GetDocumentHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "getResourcePropertyDocument"); handler.setMethod(method); return handler; }
protected MessageHandler createSubscribeHandler() { MessageHandler handler = new SubscribeHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "subscribe"); handler.setMethod(method); return handler; }
protected MessageHandler createGetMultipleHandler() { MessageHandler handler = new GetMultipleHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "getMultipleResourceProperties"); handler.setMethod(method); return handler; }
protected MessageHandler createAddHandler() { MessageHandler handler = new AddHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "add"); handler.setMethod(method); return handler; }
protected MessageHandler createGetHandler() { MessageHandler handler = new GetHandler(); Method method = ReflectUtils.getFirstMethod(getClass(), "getResourceProperty"); handler.setMethod(method); return handler; }