001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ConnectionManager.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.binding.proxy.connection;
030:
031: /**
032: * This interface specifies the interactions between the proxy binding and a
033: * connection manager that manages the connection between JBI instances.
034: *
035: * @author Sun Microsystems, Inc
036: */
037: public interface ConnectionManager {
038: /**
039: * Prepare the ConnectionManager for a new Thread.
040: *
041: */
042: void prepare() throws ConnectionException;
043:
044: /**
045: * Creates a ServerConnection.
046: * @param instanceId a unique id for this connection.
047: * @return ServerConnection to use.
048: * @throws javax.jbi.JBIException if there is a problem.
049: */
050: ServerConnection getServerConnection() throws ConnectionException;
051:
052: /**
053: * Get a ClientConnection targetted at a particular instance.
054: * @param instanceId a unique id for this JBI instance.
055: * @return ClientConnection to use.
056: * @throws javax.jbi.JBIException if there is a problem.
057: */
058: ClientConnection getClientConnection(String instanceId)
059: throws ConnectionException;
060:
061: /**
062: * Get an EventConnection.
063: * @param instanceId a unique id for this JBI instance.
064: * @return ClientConnection to use.
065: * @throws javax.jbi.JBIException if there is a problem.
066: */
067: EventConnection getEventConnection() throws ConnectionException;
068:
069: /**
070: * Close the EventConnection.
071: */
072: void closeServerConnection();
073:
074: /**
075: * Close the EventConnection.
076: */
077: void closeClientConnection();
078:
079: /**
080: * Close the EventConnection.
081: */
082: void closeEventConnection();
083:
084: /**
085: * Queue an Event generated outside the event thread.
086: *
087: * @param eventInfo describing the event.
088: * @throws javax.jbi.JBIException if there is a problem.
089: */
090: void queueEvent(EventInfo ei) throws EventException;
091:
092: /**
093: * Gets the instance id of this connection.,
094: * @return String containing instance id.
095: */
096: String getInstanceId();
097:
098: /**
099: * Gets the external instance id of this connection.,
100: * @return String containing instance id.
101: */
102: String getExternalInstanceId();
103:
104: }
|