Package com.maverick.multiplex

Examples of com.maverick.multiplex.ChannelOpenException


    if(agent.getConfiguration().isRemoteTunnelsRequireConfirmation()) {
      if(!agent.getGUI().confirm(AgentClientGUI.WARNING, Messages.getString("RemoteForwardingChannelListener.confirmRemoteTunnel")//$NON-NLS-1$$
        Messages.getString("RemoteForwardingChannelListener.cancelRemoteTunnel"),    //$NON-NLS-1$$
        Messages.getString("RemoteForwardingChannelListener.incoming.title"),   //$NON-NLS-1$$
        MessageFormat.format(Messages.getString("RemoteForwardingChannelListener.incoming.text"), new Object[] { destinationHost + ":" + destinationPort } ))) {  //$NON-NLS-1$$
        throw new ChannelOpenException(ChannelOpenException.CHANNEL_REFUSED, "Rejected by user.");
      }
    }   

    configuration = new DefaultTunnel(id,
            type,
            transport,
            sourceInterface,
            sourcePort,
            destinationPort,
            destinationHost,
            true,
            false,
            name,
            launchId);

        try {
            this.socket = new Socket(destinationHost, destinationPort);
        } catch ( IOException ioe) {
            throw new ChannelOpenException(ChannelOpenException.CONNECT_FAILED, "Failed to open socket.");
        }
    return null;
  }
View Full Code Here


      launchId = reader.readString();
      filename = reader.readString();

      LaunchSession launchSession = LaunchSessionFactory.getInstance().getLaunchSession(launchId);
      if (launchSession == null) {
        throw new ChannelOpenException(ChannelOpenException.CHANNEL_REFUSED, "No launch session with ID " + launchId + ", cannot read file " + filename + " for " + name);
      }

      launchSession.checkAccessRights(null, agent.getSession());

      ExtensionDescriptor descriptor = ExtensionStore.getInstance().getExtensionDescriptor(name);
      if (!descriptor.containsFile(filename))
        throw new ChannelOpenException(ChannelOpenException.CHANNEL_REFUSED, "Application does not contain file " + filename + " in extension " + name);

      this.file = descriptor.getFile(filename);
      this.in = new FileInputStream(file);

    } catch (Exception e) {
      throw new ChannelOpenException(ChannelOpenException.CHANNEL_REFUSED, e.getMessage());
    }

    return null;

  }
View Full Code Here

        id = reader.readString();

        if (initiator) {
            System.out.println("Opening intiator channel");
            if (streamManager.containsChannel(id, true)) {
                throw new ChannelOpenException(ChannelOpenException.CHANNEL_REFUSED,
                                "Cannot create channel (as initiator) when channel with same ID already exists.");
            }
            streamManager.putChannel(this);
            System.out.println("Opened intiator channel");
        } else {
View Full Code Here

        log.debug("Opening. Id is '" + id + "', initiator is '" + initiator + "'");
        // #endif

        if (initiator) {
            if (streamManager.containsChannel(id, true)) {
                throw new ChannelOpenException(ChannelOpenException.CHANNEL_REFUSED,
                                "Cannot create channel (as initiator) when channel with same ID already exists.");
            }
            streamManager.putChannel(this);
        } else {
            // #ifdef DEBUG
            log.debug("Waiting for initiator with ID '" + id + "'");
            // #endif
            try {
                streamManager.waitForInitiator(id, initiatorWaitTimeout);
            } catch (IllegalStateException e) {
                throw new ChannelOpenException(ChannelOpenException.CHANNEL_REFUSED, "Timeout waiting for initiator");
            } catch (InterruptedException e) {
                throw new ChannelOpenException(ChannelOpenException.CHANNEL_REFUSED, "Interrupted waiting for initiator");
            }
            // #ifdef DEBUG
            log.debug("Got initiator with ID '" + id + "'");
            // #endif
            streamManager.putChannel(this);
View Full Code Here

    this.hostname = msg.readString();
    this.port = (int) msg.readInt();
        try {
            this.socket = CustomSocketFactory.getDefault().createSocket(hostname, port);
        } catch (IOException ioe) {
            throw new ChannelOpenException(ChannelOpenException.CONNECT_FAILED, ioe.getMessage());
        }
        return null;
  }
View Full Code Here

TOP

Related Classes of com.maverick.multiplex.ChannelOpenException

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.