javax.xml.rpc.handler.HandlerInfo Java Examples

The following examples show how to use javax.xml.rpc.handler.HandlerInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ServiceRefFactory.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry,
        HandlerInfo handlerInfo, List<String> soaprolesToAdd) {
    HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
    @SuppressWarnings("unchecked") // Can't change the API
    Iterator<Handler> iter = handlerChain.iterator();
    while (iter.hasNext()) {
        Handler handler = iter.next();
        handler.init(handlerInfo);
    }
    String[] soaprolesRegistered = handlerChain.getRoles();
    String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
    int i;
    for (i = 0;i < soaprolesRegistered.length; i++) {
        soaproles[i] = soaprolesRegistered[i];
    }
    for (int j = 0; j < soaprolesToAdd.size(); j++) {
        soaproles[i+j] = soaprolesToAdd.get(j);
    }
    handlerChain.setRoles(soaproles);
    handlerRegistry.setHandlerChain(portName, handlerChain);
}
 
Example #2
Source File: ServiceRefFactory.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry,
        HandlerInfo handlerInfo, ArrayList<String> soaprolesToAdd) {
    HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
    @SuppressWarnings("unchecked") // Can't change the API
    Iterator<Handler> iter = handlerChain.iterator();
    while (iter.hasNext()) {
        Handler handler = iter.next();
        handler.init(handlerInfo);
    }
    String[] soaprolesRegistered = handlerChain.getRoles();
    String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
    int i;
    for (i = 0;i < soaprolesRegistered.length; i++)
        soaproles[i] = soaprolesRegistered[i];
    for (int j = 0; j < soaprolesToAdd.size(); j++)
        soaproles[i+j] = soaprolesToAdd.get(j);
    handlerChain.setRoles(soaproles);
    handlerRegistry.setHandlerChain(portName, handlerChain);
}
 
Example #3
Source File: ServiceRefFactory.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry,
        HandlerInfo handlerInfo, ArrayList<String> soaprolesToAdd) {
    HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
    @SuppressWarnings("unchecked") // Can't change the API
    Iterator<Handler> iter = handlerChain.iterator();
    while (iter.hasNext()) {
        Handler handler = iter.next();
        handler.init(handlerInfo);
    }
    String[] soaprolesRegistered = handlerChain.getRoles();
    String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
    int i;
    for (i = 0;i < soaprolesRegistered.length; i++)
        soaproles[i] = soaprolesRegistered[i];
    for (int j = 0; j < soaprolesToAdd.size(); j++)
        soaproles[i+j] = soaprolesToAdd.get(j);
    handlerChain.setRoles(soaproles);
    handlerRegistry.setHandlerChain(portName, handlerChain);
}
 
Example #4
Source File: AxisService.java    From tomee with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings({"unchecked"})
private List<HandlerInfo> createHandlerInfos(List<HandlerChainData> handlerChains) throws ClassNotFoundException {
    if (handlerChains == null || handlerChains.isEmpty()) return null;
    List<HandlerData> handlers = handlerChains.get(0).getHandlers();

    List<HandlerInfo> handlerInfos = new ArrayList<>(handlers.size());
    for (HandlerData handler : handlers) {
        Class<?> handlerClass = handler.getHandlerClass();
        Map initParams = new HashMap(handler.getInitParams());
        QName[] headers = handler.getSoapHeaders().toArray(new QName[handler.getSoapHeaders().size()]);
        HandlerInfo handlerInfo = new HandlerInfo(handlerClass, initParams, headers);
        handlerInfos.add(handlerInfo);
    }

    return handlerInfos;
}
 
Example #5
Source File: AxisService.java    From tomee with Apache License 2.0 5 votes vote down vote up
@Override
protected HttpListener createPojoWsContainer(ClassLoader loader, URL moduleBaseUrl, PortData port, String serviceId, Class target, Context context, String contextRoot, Map<String, Object> bdgs, ServiceConfiguration serviceInfos) throws Exception {
    ClassLoader classLoader = target.getClassLoader();

    // todo build JaxRpcServiceInfo in assembler
    JaxRpcServiceInfo serviceInfo = getJaxRpcServiceInfo(classLoader);

    // Build java service descriptor
    JavaServiceDescBuilder javaServiceDescBuilder = new JavaServiceDescBuilder(serviceInfo, classLoader);
    JavaServiceDesc serviceDesc = javaServiceDescBuilder.createServiceDesc();

    // Create service
    RPCProvider provider = new PojoProvider();
    SOAPService service = new SOAPService(null, provider, null);
    service.setServiceDescription(serviceDesc);

    // Set class name
    service.setOption("className", target.getName());

    // Add Handler Chain
    List<HandlerInfo> handlerInfos = createHandlerInfos(port.getHandlerChains());
    HandlerInfoChainFactory handlerInfoChainFactory = new HandlerInfoChainFactory(handlerInfos);
    service.setOption(org.apache.axis.Constants.ATTR_HANDLERINFOCHAIN, handlerInfoChainFactory);

    // Create container
    AxisWsContainer container = new AxisWsContainer(port.getWsdlUrl(), service, null, classLoader);
    wsContainers.put(serviceId, container);
    return container;
}
 
Example #6
Source File: HandlerChainImpl.java    From tomee with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({"unchecked"})
public HandlerChainImpl(List<HandlerInfo> handlerInfos, String[] roles) {
    this.roles = roles;
    for (int i = 0; i < handlerInfos.size(); i++) {
        HandlerInfo handlerInfo = handlerInfos.get(i);
        try {
            Handler handler = (Handler) handlerInfo.getHandlerClass().newInstance();
            handler.init(handlerInfo);
            add(handler);
        } catch (Exception e) {
            throw new JAXRPCException("Unable to initialize handler class: " + handlerInfo.getHandlerClass().getName(), e);
        }
    }
}
 
Example #7
Source File: LoggingHandler.java    From jplag with GNU General Public License v3.0 4 votes vote down vote up
public void init(HandlerInfo arg) {
	info=arg;
}
 
Example #8
Source File: JPlagClientAccessHandler.java    From jplag with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Save the HandlerInfo object
 */
public void init(HandlerInfo arg) {
	info=arg;
}
 
Example #9
Source File: JPlagServerAccessHandler.java    From jplag with GNU General Public License v3.0 4 votes vote down vote up
public void init(HandlerInfo arg) {
	info = arg;
}
 
Example #10
Source File: JPlagClientAccessHandler.java    From jplag with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Save the HandlerInfo object
 */
public void init(HandlerInfo arg) {
	info = arg;
}
 
Example #11
Source File: EjbRpcProvider.java    From tomee with Apache License 2.0 4 votes vote down vote up
public EjbRpcProvider(BeanContext ejbDeployment, List<HandlerInfo> handlerInfos) {
    this.ejbDeployment = ejbDeployment;
    this.handlerInfos = handlerInfos;
}
 
Example #12
Source File: HandlerChainImpl.java    From tomee with Apache License 2.0 4 votes vote down vote up
public HandlerChainImpl(List<HandlerInfo> handlerInfos) {
    this(handlerInfos, null);
}