Java Code Examples for javax.xml.ws.handler.Handler

The following examples show how to use javax.xml.ws.handler.Handler. These examples are extracted from open source projects. 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
public synchronized void dispose() {
    if (disposed) {
        return;
    }
    disposed = true;

    masterTubeline.preDestroy();

    for (Handler handler : binding.getHandlerChain()) {
        for (Method method : handler.getClass().getMethods()) {
            if (method.getAnnotation(PreDestroy.class) == null) {
                continue;
            }
            try {
                method.invoke(handler);
            } catch (Exception e) {
                logger.log(Level.WARNING, HandlerMessages.HANDLER_PREDESTROY_IGNORE(e.getMessage()), e);
            }
            break;
        }
    }
    closeManagedObjectManager();
    LazyMOMProvider.INSTANCE.unregisterEndpoint(this);
}
 
Example 2
Source Project: openjdk-jdk8u   Source File: WSEndpointImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public synchronized void dispose() {
    if (disposed) {
        return;
    }
    disposed = true;

    masterTubeline.preDestroy();

    for (Handler handler : binding.getHandlerChain()) {
        for (Method method : handler.getClass().getMethods()) {
            if (method.getAnnotation(PreDestroy.class) == null) {
                continue;
            }
            try {
                method.invoke(handler);
            } catch (Exception e) {
                logger.log(Level.WARNING, HandlerMessages.HANDLER_PREDESTROY_IGNORE(e.getMessage()), e);
            }
            break;
        }
    }
    closeManagedObjectManager();
    LazyMOMProvider.INSTANCE.unregisterEndpoint(this);
}
 
Example 3
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            WSBinding binding = getBinding();
            List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
            if (!logicalSnapShot.isEmpty()) {
                handlers.addAll(logicalSnapShot);
                if (binding.getSOAPVersion() == null) {
                    processor = new XMLHandlerProcessor(this, binding,
                            handlers);
                } else {
                    processor = new SOAPHandlerProcessor(true, this, binding,
                            handlers);
                }
            }
    }
}
 
Example 4
Source Project: cxf   Source File: AnnotationHandlerChainBuilderTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testFindHandlerChainAnnotation() {
    HandlerTestImpl handlerTestImpl = new HandlerTestImpl();
    AnnotationHandlerChainBuilder chainBuilder = new AnnotationHandlerChainBuilder();
    @SuppressWarnings("rawtypes")
    List<Handler> handlers = chainBuilder
        .buildHandlerChainFromClass(handlerTestImpl.getClass(),
                                    null,
                                    null,
                                    null);
    assertNotNull(handlers);
    assertEquals(9, handlers.size());
    assertEquals(TestLogicalHandler.class, handlers.get(0).getClass());
    assertEquals(TestLogicalHandler.class, handlers.get(1).getClass());
    assertEquals(TestLogicalHandler.class, handlers.get(2).getClass());
    assertEquals(TestLogicalHandler.class, handlers.get(3).getClass());
    assertEquals(TestLogicalHandler.class, handlers.get(4).getClass());
    assertEquals(TestLogicalHandler.class, handlers.get(5).getClass());
    assertEquals(TestLogicalHandler.class, handlers.get(6).getClass());
    assertEquals(TestProtocolHandler.class, handlers.get(7).getClass());
    assertEquals(TestProtocolHandler.class, handlers.get(8).getClass());
}
 
Example 5
public Handler<?>[] getHandlerchain() {
   Handler<?>[] result = new Handler[0];
   if (this.beforeSecurity != null && !this.beforeSecurity.isEmpty()) {
      result = (Handler[])((Handler[])ArrayUtils.addAll(result, this.beforeSecurity.toArray(new Handler[0])));
   }

   if (this.securityHandler != null) {
      result = (Handler[])((Handler[])ArrayUtils.addAll(result, this.securityHandler.toArray(new Handler[0])));
   }

   if (this.afterSecurity != null && !this.afterSecurity.isEmpty()) {
      result = (Handler[])((Handler[])ArrayUtils.addAll(result, this.afterSecurity.toArray(new Handler[0])));
   }

   if (this.featureHandlers != null && !this.featureHandlers.isEmpty()) {
      result = (Handler[])((Handler[])ArrayUtils.addAll(result, this.featureHandlers.toArray(new Handler[0])));
   }

   result = HandlersLoader.addingDefaultHandlers(result);
   return result;
}
 
Example 6
Source Project: cxf   Source File: HandlerChainBuilder.java    License: Apache License 2.0 6 votes vote down vote up
private void configureHandler(Handler<?> handler, PortComponentHandlerType h) {
    if (!handlerInitEnabled) {
        return;
    }

    if (h.getInitParam().isEmpty()) {
        return;
    }

    Map<String, String> params = new HashMap<>();

    for (ParamValueType param : h.getInitParam()) {
        params.put(trimString(param.getParamName() == null ? null : param.getParamName().getValue()),
                   trimString(param.getParamValue() == null ? null : param.getParamValue().getValue()));
    }

    Method initMethod = getInitMethod(handler);
    if (initMethod != null) {
        initializeViaInitMethod(handler, params, initMethod);
    } else {
        initializeViaInjection(handler, params);
    }
}
 
Example 7
public Handler<?>[] getHandlerchain() {
   Handler<?>[] result = new Handler[0];
   if (this.beforeSecurity != null && !this.beforeSecurity.isEmpty()) {
      result = (Handler[])((Handler[])ArrayUtils.addAll(result, this.beforeSecurity.toArray(new Handler[0])));
   }

   if (this.securityHandler != null) {
      result = (Handler[])((Handler[])ArrayUtils.addAll(result, this.securityHandler.toArray(new Handler[0])));
   }

   if (this.afterSecurity != null && !this.afterSecurity.isEmpty()) {
      result = (Handler[])((Handler[])ArrayUtils.addAll(result, this.afterSecurity.toArray(new Handler[0])));
   }

   if (this.featureHandlers != null && !this.featureHandlers.isEmpty()) {
      result = (Handler[])((Handler[])ArrayUtils.addAll(result, this.featureHandlers.toArray(new Handler[0])));
   }

   result = HandlersLoader.addingDefaultHandlers(result);
   return result;
}
 
Example 8
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            WSBinding binding = getBinding();
            List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
            if (!logicalSnapShot.isEmpty()) {
                handlers.addAll(logicalSnapShot);
                if (binding.getSOAPVersion() == null) {
                    processor = new XMLHandlerProcessor(this, binding,
                            handlers);
                } else {
                    processor = new SOAPHandlerProcessor(true, this, binding,
                            handlers);
                }
            }
    }
}
 
Example 9
/**
 * Adds the in out logger.
 *
 * @param bindingProvider the binding provider
 */
@SuppressWarnings("rawtypes")
public static void addInOutLoggerHandler(Object port, boolean soapfaultHandler) {
	if (port instanceof BindingProvider) {
		BindingProvider bindingProvider = (BindingProvider) port;
		List<Handler> handlerChain = new ArrayList<Handler>();
		handlerChain.addAll(bindingProvider.getBinding().getHandlerChain());
		handlerChain.add(new LoggingHandler());
		if(soapfaultHandler){
			handlerChain.add(new SoapFaultHandler());
		}
		bindingProvider.getBinding().setHandlerChain(handlerChain);
	} else {
		LOG.warn("BindingProvider provider expected, get a " + port);
	}
}
 
Example 10
public static void addInOutLoggerHandler(Object port, boolean soapfaultHandler) {
   if (port instanceof BindingProvider) {
      BindingProvider bindingProvider = (BindingProvider)port;
      List<Handler> handlerChain = new ArrayList();
      handlerChain.addAll(bindingProvider.getBinding().getHandlerChain());
      handlerChain.add(new LoggingHandler());
      if (soapfaultHandler) {
         handlerChain.add(new SoapFaultHandler());
      }

      bindingProvider.getBinding().setHandlerChain(handlerChain);
   } else {
      LOG.warn("BindingProvider provider expected, get a " + port);
   }

}
 
Example 11
Source Project: cxf   Source File: HandlerChainBuilder.java    License: Apache License 2.0 6 votes vote down vote up
protected List<Handler> buildHandlerChain(PortComponentHandlerType ht, ClassLoader classLoader) {
    List<Handler> handlerChain = new ArrayList<>();
    try {
        final boolean fineLog = LOG.isLoggable(Level.FINE);
        if (fineLog) {
            LOG.log(Level.FINE, "loading handler", trimString(ht.getHandlerName().getValue()));
        }

        Class<? extends Handler> handlerClass = Class.forName(
                                                              trimString(ht.getHandlerClass()
                                                                  .getValue()), true, classLoader)
            .asSubclass(Handler.class);

        Handler<?> handler = handlerClass.newInstance();
        if (fineLog) {
            LOG.fine("adding handler to chain: " + handler);
        }
        configureHandler(handler, ht);
        handlerChain.add(handler);
    } catch (Exception e) {
        throw new WebServiceException(BUNDLE.getString("HANDLER_INSTANTIATION_EXC"), e);
    }
    return handlerChain;
}
 
Example 12
/**
 * Adds the in out logger.
 *
 * @param bindingProvider the binding provider
 */
@SuppressWarnings("rawtypes")
public static void addInOutLoggerHandler(Object port, boolean soapfaultHandler) {
	if (port instanceof BindingProvider) {
		BindingProvider bindingProvider = (BindingProvider) port;
		List<Handler> handlerChain = new ArrayList<Handler>();
		handlerChain.addAll(bindingProvider.getBinding().getHandlerChain());
		handlerChain.add(new LoggingHandler());
		if(soapfaultHandler){
			handlerChain.add(new SoapFaultHandler());
		}
		bindingProvider.getBinding().setHandlerChain(handlerChain);
	} else {
		LOG.warn("BindingProvider provider expected, get a " + port);
	}
}
 
Example 13
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            WSBinding binding = getBinding();
            List<LogicalHandler> logicalSnapShot= ((BindingImpl) binding).getHandlerConfig().getLogicalHandlers();
            if (!logicalSnapShot.isEmpty()) {
                handlers.addAll(logicalSnapShot);
                if (binding.getSOAPVersion() == null) {
                    processor = new XMLHandlerProcessor(this, binding,
                            handlers);
                } else {
                    processor = new SOAPHandlerProcessor(true, this, binding,
                            handlers);
                }
            }
    }
}
 
Example 14
Source Project: dropwizard-jaxws   Source File: ClientBuilderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void buildClient() {

    Handler<?> handler = mock(Handler.class);

    Interceptor<?> inInterceptor = mock(Interceptor.class);
    Interceptor<?> inFaultInterceptor = mock(Interceptor.class);
    Interceptor<?> outInterceptor = mock(Interceptor.class);
    Interceptor<?> outFaultInterceptor = mock(Interceptor.class);

    ClientBuilder<Object> builder = new ClientBuilder<>(Object.class, "address")
            .connectTimeout(1234)
            .receiveTimeout(5678)
            .handlers(handler, handler)
            .bindingId("binding id")
            .cxfInInterceptors(inInterceptor, inInterceptor)
            .cxfInFaultInterceptors(inFaultInterceptor, inFaultInterceptor)
            .cxfOutInterceptors(outInterceptor, outInterceptor)
            .cxfOutFaultInterceptors(outFaultInterceptor, outFaultInterceptor);

    assertThat(builder.getAddress(), equalTo("address"));
    assertThat(builder.getServiceClass(), equalTo(Object.class));
    assertThat(builder.getConnectTimeout(), equalTo(1234));
    assertThat(builder.getReceiveTimeout(), equalTo(5678));
    assertThat(builder.getBindingId(), equalTo("binding id"));
    assertThat(builder.getCxfInInterceptors(), contains(new Interceptor<?>[]{ inInterceptor, inInterceptor }));
    assertThat(builder.getCxfInFaultInterceptors(), contains(new Interceptor<?>[]{ inFaultInterceptor, inFaultInterceptor }));
    assertThat(builder.getCxfOutInterceptors(), contains(new Interceptor<?>[]{ outInterceptor, outInterceptor }));
    assertThat(builder.getCxfOutFaultInterceptors(), contains(new Interceptor<?>[]{ outFaultInterceptor, outFaultInterceptor }));
}
 
Example 15
Source Project: openjdk-jdk9   Source File: HTTPBindingImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method separates the logical and protocol handlers and
 * sets the HandlerConfiguration.
 * Only logical handlers are allowed with HTTPBinding.
 * Setting SOAPHandlers throws WebServiceException
 */
public void setHandlerChain(List<Handler> chain) {
    for (Handler handler : chain) {
        if (!(handler instanceof LogicalHandler)) {
            throw new WebServiceException(ClientMessages.NON_LOGICAL_HANDLER_SET(handler.getClass()));
        }
    }
    setHandlerConfig(new HandlerConfiguration(Collections.<String>emptySet(), chain));
}
 
Example 16
HandlerResolver getResolver() {
    return new HandlerResolver() {
        public List<Handler> getHandlerChain(PortInfo portInfo) {
            return new ArrayList<Handler>(
                handlerModel.getHandlersForPortInfo(portInfo).getHandlers());
        }
    };
}
 
Example 17
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
            List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
            if (!msgHandlersSnapShot.isEmpty()) {
                handlers.addAll(msgHandlersSnapShot);
                roles = new HashSet<String>();
                roles.addAll(handlerConfig.getRoles());
                processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
            }
    }
}
 
Example 18
private void setUpHandlersOnce() {
    handlers = new ArrayList<Handler>();
    List<LogicalHandler> logicalSnapShot= ((BindingImpl) getBinding()).getHandlerConfig().getLogicalHandlers();
    if (!logicalSnapShot.isEmpty()) {
        handlers.addAll(logicalSnapShot);
    }
}
 
Example 19
Source Project: tomee   Source File: ClientHandlerResolverImpl.java    License: Apache License 2.0 5 votes vote down vote up
public void destroyHandlers() {
    final List<ClientInjectionProcessor<Handler>> handlerInstances = new ArrayList<ClientInjectionProcessor<Handler>>(this.handlerInstances);
    this.handlerInstances.clear();
    for (final ClientInjectionProcessor<Handler> handlerInstance : handlerInstances) {
        handlerInstance.preDestroy();
    }
}
 
Example 20
Source Project: cxf   Source File: AnnotationHandlerChainBuilderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testFindHandlerChainAnnotationPerPortServiceBindingWildcard() {
    HandlerTestImpl handlerTestImpl = new HandlerTestImpl();
    AnnotationHandlerChainBuilder chainBuilder = new AnnotationHandlerChainBuilder();
    QName portQName = new QName("http://apache.org/handler_test", "SoapPortWildcard");
    QName serviceQName = new QName("http://apache.org/handler_test", "SoapServiceWildcard");
    String bindingID = "BindingUnknow";
    @SuppressWarnings("rawtypes")
    List<Handler> handlers = chainBuilder
        .buildHandlerChainFromClass(handlerTestImpl.getClass(), portQName, serviceQName, bindingID);
    assertNotNull(handlers);
    assertEquals(7, handlers.size());
}
 
Example 21
Source Project: cxf   Source File: JaxWsProxyFactoryBean.java    License: Apache License 2.0 5 votes vote down vote up
private void buildHandlerChain(JaxWsClientProxy cp) {
    AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder();
    JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)getServiceFactory();
    @SuppressWarnings("rawtypes")
    List<Handler> chain = new ArrayList<>(handlers);
    if (loadHandlers) {
        chain.addAll(builder.buildHandlerChainFromClass(sf.getServiceClass(),
                                                        sf.getEndpointInfo().getName(),
                                                        sf.getServiceQName(),
                                                        this.getBindingId()));
    }

    if (!chain.isEmpty()) {
        ResourceManager resourceManager = getBus().getExtension(ResourceManager.class);
        List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
        resourceManager = new DefaultResourceManager(resolvers);
        resourceManager.addResourceResolver(new WebServiceContextResourceResolver());
        ResourceInjector injector = new ResourceInjector(resourceManager);
        for (Handler<?> h : chain) {
            if (Proxy.isProxyClass(h.getClass()) && getServiceClass() != null) {
                injector.inject(h, getServiceClass());
                injector.construct(h, getServiceClass());
            } else {
                injector.inject(h);
                injector.construct(h);
            }
        }
    }

    cp.getBinding().setHandlerChain(chain);
}
 
Example 22
Source Project: cxf   Source File: HandlerChainBuilderTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testChainSorting() {
    List<Handler> sortedHandlerChain = builder.sortHandlers(Arrays.asList(allHandlers));
    assertSame(logicalHandlers[0], sortedHandlerChain.get(0));
    assertSame(logicalHandlers[1], sortedHandlerChain.get(1));
    assertSame(protocolHandlers[0], sortedHandlerChain.get(2));
    assertSame(protocolHandlers[1], sortedHandlerChain.get(3));
}
 
Example 23
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example 24
public HandlerAnnotationInfo getHandlersForPortInfo(PortInfo info){

        HandlerAnnotationInfo handlerInfo = new HandlerAnnotationInfo();
        List<Handler> handlerClassList = new ArrayList<Handler>();
        Set<String> roles = new HashSet<String>();

        for(HandlerChainType hchain : handlerChains) {
            boolean hchainMatched = false;
            if((!hchain.isConstraintSet()) ||
                    JAXWSUtils.matchQNames(info.getServiceName(), hchain.getServiceNamePattern()) ||
                    JAXWSUtils.matchQNames(info.getPortName(), hchain.getPortNamePattern()) ||
                    hchain.getProtocolBindings().contains(info.getBindingID()) ){
                hchainMatched = true;

            }
            if(hchainMatched) {
                for(HandlerType handler : hchain.getHandlers()) {
                    try {
                        Handler handlerClass = (Handler) loadClass(annotatedClass.getClassLoader(),
                                handler.getHandlerClass()).newInstance();
                        callHandlerPostConstruct(handlerClass);
                        handlerClassList.add(handlerClass);
                    } catch (InstantiationException ie){
                        throw new RuntimeException(ie);
                    } catch (IllegalAccessException e) {
                        throw new RuntimeException(e);
                    }

                    roles.addAll(handler.getSoapRoles());
                }

            }
        }

        handlerInfo.setHandlers(handlerClassList);
        handlerInfo.setRoles(roles);
        return handlerInfo;

    }
 
Example 25
Source Project: juddi   Source File: JUDDIServiceProvider.java    License: Apache License 2.0 5 votes vote down vote up
private void registerService(BindingProvider bindingProvider) {
	Binding binding = bindingProvider.getBinding();
	List<Handler> handlerChain = binding.getHandlerChain();

	handlerChain.add(new LoggingHandler());

	// set the handler chain again for the changes to take effect
	binding.setHandlerChain(handlerChain);
}
 
Example 26
Source Project: tomee   Source File: ClientHandlerResolverImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public List<Handler> getHandlerChain(final javax.xml.ws.handler.PortInfo portInfo) {
    List<Handler> chain = new ArrayList<Handler>();
    for (final HandlerChainMetaData handlerChain : handlerChains) {
        List<Handler> handlers = buildHandlers(portInfo, handlerChain);
        handlers = sortHandlers(handlers);
        chain.addAll(handlers);
    }
    chain = sortHandlers(chain);
    return chain;
}
 
Example 27
void setUpProcessor() {
    if (handlers == null) {
            // Take a snapshot, User may change chain after invocation, Same chain
            // should be used for the entire MEP
            handlers = new ArrayList<Handler>();
            HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
            List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
            if (!soapSnapShot.isEmpty()) {
                handlers.addAll(soapSnapShot);
                roles = new HashSet<String>();
                roles.addAll(handlerConfig.getRoles());
                processor = new SOAPHandlerProcessor(true, this, getBinding(), handlers);
            }
    }
}
 
Example 28
private void setUpHandlersOnce() {
    handlers = new ArrayList<Handler>();
    HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
    List<SOAPHandler> soapSnapShot= handlerConfig.getSoapHandlers();
    if (!soapSnapShot.isEmpty()) {
        handlers.addAll(soapSnapShot);
        roles = new HashSet<String>();
        roles.addAll(handlerConfig.getRoles());
    }
}
 
Example 29
private void setUpHandlersOnce() {
    handlers = new ArrayList<Handler>();
    HandlerConfiguration handlerConfig = ((BindingImpl) getBinding()).getHandlerConfig();
    List<MessageHandler> msgHandlersSnapShot= handlerConfig.getMessageHandlers();
    if (!msgHandlersSnapShot.isEmpty()) {
        handlers.addAll(msgHandlersSnapShot);
        roles = new HashSet<String>();
        roles.addAll(handlerConfig.getRoles());
    }
}
 
Example 30
@SuppressWarnings("rawtypes")
public CampaignServiceInterfaceImpl() {
  binding = Mockito.mock(Binding.class);
  RequestInfoXPathSet requestInfoXPathSet = Mockito.mock(RequestInfoXPathSet.class);
  ResponseInfoXPathSet responseInfoXPathSet = Mockito.mock(ResponseInfoXPathSet.class);
  List<Handler> handlerList =
      Lists.<Handler>newArrayList(
          new JaxWsSoapContextHandler(requestInfoXPathSet, responseInfoXPathSet));
  when(binding.getHandlerChain()).thenReturn(handlerList);
}