@Override protected PropertyHandlerMapping newPropertyHandlerMapping(URL url) throws IOException, XmlRpcException { PropertyHandlerMapping mapping = new PropertyHandlerMapping(); RequestProcessorFactoryFactory factory = new RequestSpecificProcessorFactoryFactory() { @Override protected Object getRequestProcessor(Class class1, XmlRpcRequest request) throws XmlRpcException { return super.getRequestProcessor(class1, request); } }; mapping.setRequestProcessorFactoryFactory(factory); mapping.load(Thread.currentThread().getContextClassLoader(), url); return mapping; } }
@Override protected PropertyHandlerMapping newPropertyHandlerMapping(URL url) throws IOException, XmlRpcException { PropertyHandlerMapping phm = new PropertyHandlerMapping() { @Override public XmlRpcHandler getHandler(String pHandlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException { if (!pHandlerName.contains(".")) { return super.getHandler("default." + pHandlerName); } else { return super.getHandler(pHandlerName); } } }; phm.setRequestProcessorFactoryFactory(procfac); phm.addHandler("default", HomeMaticCalls.class); phm.addHandler("system", SystemCalls.class); phm.setVoidMethodEnabled(true); return phm; }
/** * Adds an instance of this class to the given handler * mapping. */ public static void addSystemHandler(final PropertyHandlerMapping pMapping) throws XmlRpcException { final RequestProcessorFactoryFactory factory = pMapping.getRequestProcessorFactoryFactory(); final XmlRpcSystemImpl systemHandler = new XmlRpcSystemImpl(pMapping); pMapping.setRequestProcessorFactoryFactory(new RequestProcessorFactoryFactory(){ public RequestProcessorFactory getRequestProcessorFactory(Class pClass) throws XmlRpcException { if (XmlRpcSystemImpl.class.equals(pClass)) { return new RequestProcessorFactory(){ public Object getRequestProcessor(XmlRpcRequest request) throws XmlRpcException { return systemHandler; } }; } else { return factory.getRequestProcessorFactory(pClass); } } }); pMapping.addHandler("system", XmlRpcSystemImpl.class); } }
/** * Adds an instance of this class to the given handler * mapping. */ public static void addSystemHandler(final PropertyHandlerMapping pMapping) throws XmlRpcException { final RequestProcessorFactoryFactory factory = pMapping.getRequestProcessorFactoryFactory(); final XmlRpcSystemImpl systemHandler = new XmlRpcSystemImpl(pMapping); pMapping.setRequestProcessorFactoryFactory(new RequestProcessorFactoryFactory(){ public RequestProcessorFactory getRequestProcessorFactory(Class pClass) throws XmlRpcException { if (XmlRpcSystemImpl.class.equals(pClass)) { return new RequestProcessorFactory(){ public Object getRequestProcessor(XmlRpcRequest request) throws XmlRpcException { return systemHandler; } }; } else { return factory.getRequestProcessorFactory(pClass); } } }); pMapping.addHandler("system", XmlRpcSystemImpl.class); } }
/** * Adds an instance of this class to the given handler * mapping. */ public static void addSystemHandler(final PropertyHandlerMapping pMapping) throws XmlRpcException { final RequestProcessorFactoryFactory factory = pMapping.getRequestProcessorFactoryFactory(); final XmlRpcSystemImpl systemHandler = new XmlRpcSystemImpl(pMapping); pMapping.setRequestProcessorFactoryFactory(new RequestProcessorFactoryFactory(){ public RequestProcessorFactory getRequestProcessorFactory(Class pClass) throws XmlRpcException { if (XmlRpcSystemImpl.class.equals(pClass)) { return new RequestProcessorFactory(){ public Object getRequestProcessor(XmlRpcRequest request) throws XmlRpcException { return systemHandler; } }; } else { return factory.getRequestProcessorFactory(pClass); } } }); pMapping.addHandler("system", XmlRpcSystemImpl.class); } }
/** Creates a new instance of {@link PropertyHandlerMapping} by * loading the property file from the given URL. Called from * {@link #newXmlRpcHandlerMapping()}. */ protected PropertyHandlerMapping newPropertyHandlerMapping(URL url) throws IOException, XmlRpcException { PropertyHandlerMapping mapping = new PropertyHandlerMapping(); mapping.setAuthenticationHandler(authenticationHandler); if (requestProcessorFactoryFactory != null) { mapping.setRequestProcessorFactoryFactory(requestProcessorFactoryFactory); } if (typeConverterFactory != null) { mapping.setTypeConverterFactory(typeConverterFactory); } else { mapping.setTypeConverterFactory(server.getTypeConverterFactory()); } mapping.setVoidMethodEnabled(server.getConfig().isEnabledForExtensions()); mapping.load(Thread.currentThread().getContextClassLoader(), url); return mapping; }
/** Creates a new instance of {@link PropertyHandlerMapping} by * loading the property file from the given URL. Called from * {@link #newXmlRpcHandlerMapping()}. */ protected PropertyHandlerMapping newPropertyHandlerMapping(URL url) throws IOException, XmlRpcException { PropertyHandlerMapping mapping = new PropertyHandlerMapping(); mapping.setAuthenticationHandler(authenticationHandler); if (requestProcessorFactoryFactory != null) { mapping.setRequestProcessorFactoryFactory(requestProcessorFactoryFactory); } if (typeConverterFactory != null) { mapping.setTypeConverterFactory(typeConverterFactory); } else { mapping.setTypeConverterFactory(server.getTypeConverterFactory()); } mapping.setVoidMethodEnabled(server.getConfig().isEnabledForExtensions()); mapping.load(Thread.currentThread().getContextClassLoader(), url); return mapping; }
org.apache.xmlrpc.server.XmlRpcServer xmlRpcServer = server.getXmlRpcServer(); PropertyHandlerMapping phm = new PropertyHandlerMapping(); phm.setRequestProcessorFactoryFactory(new NodeRequestProcessorFactoryFactory<T>(instance)); try { phm.addHandler("", instanceClass);