Package org.apache.geronimo.messaging

Examples of org.apache.geronimo.messaging.NodeException


                nodeInfo.getPort(),
              "", null, null);
            serverSocketAcceptor.setUri(bindURI);
            serverSocketAcceptor.startup();
        } catch (Exception e) {
            throw new NodeException("Can not start server", e);
        }
    }
View Full Code Here


   
    public void open() throws NodeException {
        try {
            protocol = newProtocol();
        } catch (ProtocolException e) {
            throw new NodeException("Can not create protocol", e);
        }
        Protocol curProtocol = protocol;
        while ( null != curProtocol ) {
            if ( curProtocol instanceof CallbackSocketProtocol ) {
                ((CallbackSocketProtocol) curProtocol).setListener(
                    new SocketProtocolListener() {
                        public void onClose() {
                            msgOut = null;
                            inDispatcher = null;
                            if ( null != listener ) {
                                listener.onClose();
                            }
                        }
                    });
                break;
            }
            curProtocol = curProtocol.getDownProtocol();
        }
        if ( false == curProtocol instanceof CallbackSocketProtocol ) {
            throw new AssertionError("No CallbackSocketProtocol.");
        }
       
        StreamManager streamManager = ioContext.getStreamManager();
        ReplacerResolver replacerResolver = ioContext.getReplacerResolver();
        PushSynchronization pushSynchronization =
            ioContext.getPushSynchronization();
        PopSynchronization popSynchronization =
            ioContext.getPopSynchronization();
        try {
            msgOut = new ProtocolOutInterceptor(protocol,
                streamManager, pushSynchronization, replacerResolver);
            inDispatcher = new ProtocolInDispatcher(protocol,
                streamManager, popSynchronization, replacerResolver);
        } catch (IOException e) {
            throw new NodeException("Can not set-up IO context.", e);
        }
    }
View Full Code Here

        try {
            // waits 3 seconds for a reply.
            reply = (Msg) result.get();
            reply = (Msg) result.timedGet(3000);
        } catch (TimeoutException e) {
            throw new NodeException("Join request submitted by " +
                localNodeInfo + " to " + remoteNodeInfo + " has timed out.");
        } catch (InterruptedException e) {
            throw new NodeException(e);
        } catch (InvocationTargetException e) {
            throw new NodeException(e);
        }
        Boolean isOK = (Boolean) reply.getBody().getContent();
        if ( Boolean.FALSE == isOK ) {
            throw new NodeException(remoteNodeInfo + " has refused the " +
                "join request submitted by " + localNodeInfo);
        }
        manager.registerRemoteNode(this);
    }
View Full Code Here

        if ( null != exception ) {
            for (Iterator iter = newNeighbours.iterator(); iter.hasNext();) {
                NodeInfo node = (NodeInfo) iter.next();
                leaveRemoteNode(node);
            }
            throw new NodeException("Can not apply topology.", exception);
        }
        preparedTopology = aTopology;
    }
View Full Code Here

        if ( null != exception ) {
            for (Iterator iter = newNeighbours.iterator(); iter.hasNext();) {
                NodeInfo node = (NodeInfo) iter.next();
                leaveRemoteNode(node);
            }
            throw new NodeException("Can not apply topology.", exception);
        }
        preparedTopology = aTopology;
    }
View Full Code Here

   
    public void open() throws NodeException {
        try {
            protocol = newProtocol();
        } catch (ProtocolException e) {
            throw new NodeException("Can not create protocol", e);
        }
        Protocol curProtocol = protocol;
        while ( null != curProtocol ) {
            if ( curProtocol instanceof CallbackSocketProtocol ) {
                ((CallbackSocketProtocol) curProtocol).setListener(
                    new SocketProtocolListener() {
                        public void onClose() {
                            msgOut = null;
                            inDispatcher = null;
                            if ( null != listener ) {
                                listener.onClose();
                            }
                        }
                    });
                break;
            }
            curProtocol = curProtocol.getDownProtocol();
        }
        if ( false == curProtocol instanceof CallbackSocketProtocol ) {
            throw new AssertionError("No CallbackSocketProtocol.");
        }
       
        StreamManager streamManager = ioContext.getStreamManager();
        ReplacerResolver replacerResolver = ioContext.getReplacerResolver();
        PushSynchronization pushSynchronization =
            ioContext.getPushSynchronization();
        PopSynchronization popSynchronization =
            ioContext.getPopSynchronization();
        try {
            msgOut = new ProtocolOutInterceptor(protocol,
                streamManager, pushSynchronization, replacerResolver);
            inDispatcher = new ProtocolInDispatcher(protocol,
                streamManager, popSynchronization, replacerResolver);
        } catch (IOException e) {
            throw new NodeException("Can not set-up IO context.", e);
        }
    }
View Full Code Here

        try {
            // waits 3 seconds for a reply.
            reply = (Msg) result.get();
            reply = (Msg) result.timedGet(3000);
        } catch (TimeoutException e) {
            throw new NodeException("Join request submitted by " +
                localNodeInfo + " to " + remoteNodeInfo + " has timed out.");
        } catch (InterruptedException e) {
            throw new NodeException(e);
        } catch (InvocationTargetException e) {
            throw new NodeException(e);
        }
        Boolean isOK = (Boolean) reply.getBody().getContent();
        if ( Boolean.FALSE == isOK ) {
            throw new NodeException(remoteNodeInfo + " has refused the " +
                "join request submitted by " + localNodeInfo);
        }
        manager.registerRemoteNode(this);
    }
View Full Code Here

                nodeInfo.getPort(),
              "", null, null);
            serverSocketAcceptor.setUri(bindURI);
            serverSocketAcceptor.startup();
        } catch (Exception e) {
            throw new NodeException("Can not start server", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.messaging.NodeException

Copyright © 2018 www.massapicom. 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.