Examples of ConnectHandler


Examples of demo.ConnectHandler

  public static void main(String args[]) throws Exception{
    Main2 m = new Main2();
    m.initZk();
   
    IService client = new IService(DemoConf.host, DemoConf.root, "", "", DemoConf.tmpPath);
    client.setEventHandle(Constants.CONNECT_EVENT, new ConnectHandler());
    client.setEventHandle(Constants.DISCONNECT_EVENT, new DisconnectHandler());
    client.setEventHandle(Constants.EXPIRED_EVENT, new ExpiredHandler());
    client.init();
   
    String key = "app2/key1";
View Full Code Here

Examples of demo.ConnectHandler

  public static void main(String args[]) throws Exception{
    Main m = new Main();
    m.initZk();
   
    IService client = new IService(DemoConf.host, DemoConf.root, "", "", DemoConf.tmpPath);
    client.setEventHandle(Constants.CONNECT_EVENT, new ConnectHandler());
    client.setEventHandle(Constants.DISCONNECT_EVENT, new DisconnectHandler());
    client.setEventHandle(Constants.EXPIRED_EVENT, new ExpiredHandler());
    client.init();
   
    String key = "key1";
View Full Code Here

Examples of org.apache.james.protocols.api.ConnectHandler

        List<ConnectHandlerResultHandler> resultHandlers = chain.getHandlers(ConnectHandlerResultHandler.class);
        ProtocolSession session = (ProtocolSession) attributes.get(ctx.getChannel());
        session.getLogger().info("Connection established from " + session.getRemoteHost() + " (" + session.getRemoteIPAddress()+ ")");
        if (connectHandlers != null) {
            for (int i = 0; i < connectHandlers.size(); i++) {
                ConnectHandler cHandler = connectHandlers.get(i);
               
                long start = System.currentTimeMillis();
                boolean disconnect = connectHandlers.get(i).onConnect(session);
                long executionTime = System.currentTimeMillis() - start;
               
View Full Code Here

Examples of org.apache.james.protocols.api.ConnectHandler

        List<ConnectHandlerResultHandler> resultHandlers = chain.getHandlers(ConnectHandlerResultHandler.class);
        ProtocolSession session = (ProtocolSession) attributes.get(ctx.getChannel());
        session.getLogger().info("Connection established from " + session.getRemoteHost() + " (" + session.getRemoteIPAddress()+ ")");
        if (connectHandlers != null) {
            for (int i = 0; i < connectHandlers.size(); i++) {
                ConnectHandler cHandler = connectHandlers.get(i);
               
                long start = System.currentTimeMillis();
                boolean disconnect = connectHandlers.get(i).onConnect(session);
                long executionTime = System.currentTimeMillis() - start;
               
View Full Code Here

Examples of org.apache.james.protocols.api.handler.ConnectHandler

        List<ProtocolHandlerResultHandler> resultHandlers = chain.getHandlers(ProtocolHandlerResultHandler.class);
        ProtocolSession session = (ProtocolSession) ctx.getAttachment();
        session.getLogger().info("Connection established from " + session.getRemoteHost() + " (" + session.getRemoteIPAddress()+ ")");
        if (connectHandlers != null) {
            for (int i = 0; i < connectHandlers.size(); i++) {
                ConnectHandler cHandler = connectHandlers.get(i);
               
                long start = System.currentTimeMillis();
                Response response = connectHandlers.get(i).onConnect(session);
                long executionTime = System.currentTimeMillis() - start;
               
View Full Code Here

Examples of org.apache.james.protocols.api.handler.ConnectHandler

        List<ProtocolHandlerResultHandler> resultHandlers = chain.getHandlers(ProtocolHandlerResultHandler.class);
        ProtocolSession session = (ProtocolSession) ctx.getAttachment();
        session.getLogger().info("Connection established from " + session.getRemoteAddress().getAddress().getHostAddress());
        if (connectHandlers != null) {
            for (int i = 0; i < connectHandlers.size(); i++) {
                ConnectHandler cHandler = connectHandlers.get(i);
               
                long start = System.currentTimeMillis();
                Response response = connectHandlers.get(i).onConnect(session);
                long executionTime = System.currentTimeMillis() - start;
               
View Full Code Here

Examples of org.apache.james.protocols.api.handler.ConnectHandler

        List<ProtocolHandlerResultHandler> resultHandlers = chain.getHandlers(ProtocolHandlerResultHandler.class);
        ProtocolSession session = (ProtocolSession) ctx.getAttachment();
        session.getLogger().info("Connection established from " + session.getRemoteAddress().getAddress().getHostAddress());
        if (connectHandlers != null) {
            for (int i = 0; i < connectHandlers.size(); i++) {
                ConnectHandler cHandler = connectHandlers.get(i);
               
                long start = System.currentTimeMillis();
                Response response = connectHandlers.get(i).onConnect(session);
                long executionTime = System.currentTimeMillis() - start;
               
View Full Code Here

Examples of org.apache.james.protocols.api.handler.ConnectHandler

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public void wireExtensions(Class<?> interfaceName, List<?> extension) throws WiringException {
        if (interfaceName.equals(ConnectHandler.class)) {
            // add stats for all hooks
            for (Object anExtension : extension) {
                ConnectHandler c = (ConnectHandler) anExtension;
                if (!equals(c)) {
                    String cName = c.getClass().getName();
                    try {
                        cStats.put(cName, new ConnectHandlerStats(jmxName, cName));
                    } catch (Exception e) {
                        throw new WiringException("Unable to wire Hooks", e);
                    }
View Full Code Here

Examples of org.eclipse.jetty.proxy.ConnectHandler

        ServerConnector connector = new ServerConnector(server);
        connector.setPort(8888);
        server.addConnector(connector);

        // Setup proxy handler to handle CONNECT methods
        ConnectHandler proxy = new ConnectHandler();
        server.setHandler(proxy);

        // Setup proxy servlet
        ServletContextHandler context = new ServletContextHandler(proxy, "/",
                ServletContextHandler.SESSIONS);
View Full Code Here

Examples of org.eclipse.jetty.proxy.ConnectHandler

        Server proxy = new Server();
        ServerConnector proxyConnector = new ServerConnector(proxy);
        proxy.addConnector(proxyConnector);

        ConnectHandler connectHandler = new ConnectHandler();
        proxy.setHandler(connectHandler);

        proxy.start();
        httpClient.stop();
        httpClient = new HttpClient(sslContextFactory);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.