Examples of JxtaBiDiPipe


Examples of net.jxta.util.JxtaBiDiPipe

        }       
        if (ReplicationState.isVoidMethodReturnMessage(msg)
            && ReplicationState.isAckRequiredForMessage(msg)) {
            //send immediate ack
            Message ackMsg = ReplicationState.createAckMessageFrom(msg);
            JxtaBiDiPipe thePipe = this.getPipe();
//            long tempStart = 0L;
//            if (_logger.isLoggable(Level.FINE)) {
//                tempStart = System.currentTimeMillis();
//            }
            //FIXME - we are trying this w/o synchronization
            //synchronized(thePipe) {
                try {
                    thePipe.sendMessage(ackMsg);
                } catch (IOException ex) {
                    // FIXME evaluate logging level
                    if(_pipelogger.isLoggable(Level.FINE)) {
                        _pipelogger.log(Level.FINE, "Exception sending immediate ack message", ex);
                    }
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

        }       
       if (ReplicationState.isVoidMethodReturnMessage(msg)
            && ReplicationState.isAckRequiredForMessage(msg)) {
            //FIXME send immediate ack
            Message ackMsg = ReplicationState.createBulkAckMessageFrom(msg, states);
            JxtaBiDiPipe thePipe = this.getPipe();
//            long tempStart = 0L;
//            if (_logger.isLoggable(Level.FINE)) {
//                tempStart = System.currentTimeMillis();
//            }
            //FIXME - we are trying this w/o synchronization
            //synchronized(thePipe) {
                try {
                    thePipe.sendMessage(ackMsg);
                } catch (IOException ex) {
                    // FIXME evaluate logging level
                    if(_pipelogger.isLoggable(Level.FINE)) {
                        _pipelogger.log(Level.FINE, "PipeWrapper:IOException sending ack message", ex);
                    }
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

    private boolean createPipes(int numPipes) {
        PipeConnectionResult connectionResult = null;
        ArrayList pipeWrappers = new ArrayList();
        for (int i=0; i<numPipes; i++) {
            try {
                JxtaBiDiPipe nextPipe = new JxtaBiDiPipe();
                nextPipe.setReliable(true);
                PipeWrapper pipeWrapper = new PipeWrapper("sending_pipe#" + i, PipeWrapper.SENDER_PIPE, this.getReplicateToInstanceName(), nextPipe);
                /*
                if(i == 0) {
                    this.pipe = nextPipe;
                    //this.waitForRendezvousConnection();
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

        PipeConnectionResult connectionResult = null;
        PeerID partnerPeerId = JxtaStarter.getPeerID(newPartnerInstance);
        ArrayList pipeWrappers = new ArrayList();
        for (int i=0; i<numPipes; i++) {
            try {
                JxtaBiDiPipe nextPipe = new JxtaBiDiPipe();
                nextPipe.setReliable(true);
                String nextPipeName = this.getSendingPipeNameFor(i, newPartnerInstance);
                //PipeWrapper pipeWrapper = new PipeWrapper("sending_pipe#" + i, PipeWrapper.SENDER_PIPE, newPartnerInstance, nextPipe);
                PipeWrapper pipeWrapper = new PipeWrapper(nextPipeName, PipeWrapper.SENDER_PIPE, newPartnerInstance, nextPipe);
                /*
                if(i == 0) {
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

     */   
    private void createPipesPrevious(int numPipes) {
        ArrayList pipeWrappers = new ArrayList();
        for (int i=0; i<numPipes; i++) {
            try {
                JxtaBiDiPipe nextPipe = new JxtaBiDiPipe();
                nextPipe.setReliable(true);
                PipeWrapper pipeWrapper = new PipeWrapper("sending_pipe#" + i, PipeWrapper.SENDER_PIPE, this.getReplicateToInstanceName(), nextPipe);
                /*
                if(i == 0) {
                    this.pipe = nextPipe;
                    this.waitForRendezvousConnection();
                }
                 */
                //PipeWrapper pipeWrapper = new PipeWrapper("pipe#" + i, PipeWrapper.SENDER_PIPE, this.getReplicateToInstanceName(), nextPipe);
                //this.waitForRendezvousConnection();
                if (_pipelogger.isLoggable(Level.FINEST)) {
                    _pipelogger.finest("JxtaBiDiPipeWrapper: Attempting to establish a connection");
                }
                nextPipe.connect(this.netPeerGroup,
                                null,
                                this.pipeAdv,
                                //60000,
                                300000,
                                // register as a message listener the pipeWrapper
                                pipeWrapper);
                nextPipe.setPipeEventListener(pipeWrapper);
                if (_pipelogger.isLoggable(Level.FINE)) {
                    _pipelogger.fine("Pipe connected to: " + this.getReplicateToInstanceName() + " name: " + pipeWrapper.getName());
                }
                //at this point we need to keep references around until data xchange
                //is complete
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

     *@return PipeWrapper
     */   
    PipeWrapper createPipe() {
        PipeWrapper pipeWrapper = null;
        try {
            JxtaBiDiPipe aPipe = new JxtaBiDiPipe();
            aPipe.setReliable(true);
            pipeWrapper = new PipeWrapper("created_pipe", PipeWrapper.SENDER_PIPE, this.getReplicateToInstanceName(), aPipe);

            //this.waitForRendezvousConnection();
            if(_pipelogger.isLoggable(Level.FINEST)) {
                _pipelogger.finest("JxtaBiDiPipeWrapper: Attempting to establish a connection");
            }           
            aPipe.connect(this.netPeerGroup,
                            null,
                            this.pipeAdv,
                            //60000,
                            300000,
                            // register as a message listener the pipeWrapper
                            pipeWrapper);
            aPipe.setPipeEventListener(pipeWrapper);
            if (_pipelogger.isLoggable(Level.FINE)) {
                _pipelogger.fine("Pipe connected to: " + this.getReplicateToInstanceName() + "name: " + pipeWrapper.getName());
            }
            if(_pipelogger.isLoggable(Level.FINEST)) {
                _pipelogger.finest("new JxtaBiDiPipe pipe created: " + aPipe);
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

        }
        if(pipeWrapper == null) {
            //no pipe wrapper - just return
            return false;
        }
        JxtaBiDiPipe thePipe = pipeWrapper.getPipe();
        Message theMsg = this.createMessage(state, isResponse);
        if(pipeWrapper.isPipeClosed()) {
            //no pipe - just return
            return false;
        }
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

        boolean result = false;
        if(pipeWrapper == null) {
            //no pipe wrapper - just return
            return false;
        }
        JxtaBiDiPipe thePipe = pipeWrapper.getPipe();
        Message theMsg = this.createMessage(state, isResponse);
        if(pipeWrapper.isPipeClosed()) {
            //no pipe - just return
            return false;
        }
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

   
    /* return false if cannot send
     * else true
     */
    private boolean sendOverPipe(ReplicationState state, boolean isResponse) {
        JxtaBiDiPipe thePipe = null;
        boolean result = false;
        if(!ReplicationHealthChecker.isOkToProceed()) {
            return false;
        }
        PipeWrapper thePipeWrapper = null;
View Full Code Here

Examples of net.jxta.util.JxtaBiDiPipe

        boolean result = false;
        if( !ReplicationHealthChecker.isOkToProceed() ) {
            return false;
        }
       
        JxtaBiDiPipe thePipe = null;               
        PipeWrapper thePipeWrapper = null;
        try {
            thePipeWrapper = this.getPipeWrapper();
            if(thePipeWrapper == null) {
                if (_pipelogger.isLoggable(Level.FINE)) {
                    _pipelogger.fine("JxtaReplicationSender>>sendOverPipe:null pipeWrapper - returning false");
                }
                return false;
            }
            thePipe = thePipeWrapper.getPipe();
            //System.out.println("sendOverPipe:pipe from pool= " + thePipe);
            if(thePipe == null) {
                //no pipe to return to pool - just return
                if (_pipelogger.isLoggable(Level.FINE)) {
                    _pipelogger.fine("JxtaReplicationSender>>sendOverPipe:null pipe - returning false");
                }
                return false;
            }
            try {
                if(isWaitForFastAckConfigured()) {
                    thePipeWrapper.incrementQueuedMessageCount();
                    //System.out.println("about to call sendMessage with listener");
                    //result = thePipe.sendMessage(theMsg, thePipeWrapper);
                    result = thePipe.sendMessage(theMsg);
                    //doThreadedMessageCallback(theMsg, thePipeWrapper, result);
                    /*
                    if(result) {
                        thePipeWrapper.messageSendSucceeded(theMsg);
                    } else {
                        thePipeWrapper.messageSendFailed(theMsg);
                    }
                     */
                } else {
                    result = thePipe.sendMessage(theMsg);
                }
            } catch (IOException ex) {
                result = false;
                // FIXME evaluate log level
                if(_pipelogger.isLoggable(Level.INFO)) {
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.