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: * @(#)JMXConnectorSource.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: /**
030: * JMXConnectorSource.java
031: *
032: * SUN PROPRIETARY/CONFIDENTIAL.
033: * This software is the proprietary information of Sun Microsystems, Inc.
034: * Use is subject to license terms.
035: *
036: * Created on June 13, 2005, 12:02 PM
037: */package com.sun.jbi.util.jmx;
038:
039: import java.io.File;
040: import java.util.Map;
041:
042: /**
043: * This interface is to be used by jbi components / services to get a JMX Client
044: * Connector. This is a wrapper around the JMXConnectorFactory and allows one to connect
045: * to a Connector Server, which may have proprietary extensions for Security. The
046: * corresponding client Connector Source would be made available through this interface.
047: *
048: * @author Sun Microsystems, Inc.
049: */
050: public interface JMXConnectorSource {
051: /**
052: * @param username is the username to be used for the Connection.
053: * @param password is the user password.
054: */
055: void setCredentials(String username, String password);
056:
057: /**
058: * @param secureFlag indicates whether the connection is to be secured (ex. use SSL)
059: */
060: void setIsSecure(boolean secureFlag);
061:
062: /**
063: * @param truststore path to the JKS truststore file.
064: * @param type is the type of the Keystore ( JKS, JCEKS etc)
065: * @param passwd - the truststore password
066: */
067: void setTrustStore(File truststore, String type, char[] passwd);
068:
069: /**
070: * If the JMXServiceURL is setup using this method, the host, protocol and port
071: * set independently are overridden.
072: *
073: * @param jmxServiceURL - JMX Service URL
074: */
075: void setJMXServiceURL(
076: javax.management.remote.JMXServiceURL jmxServiceURL);
077:
078: /**
079: * If the JMX Connector Server's host and port cannot be identified from the
080: * JMX Service URL or if the JMXServiceURL is not set, then this is the process
081: * of indicating this information.
082: *
083: * @param host - hostname
084: * @param port - port
085: */
086: void setHostAndPort(String host, int port);
087:
088: /**
089: * If the connection has already been created, return the existing
090: * JMXConnector unless 'forceNew' is true or the connection is currently null.
091: *
092: * @param forceNew - create a new connection
093: * @param environment - a set of attributes to determine how the connection is made.
094: * This parameter can be null. Keys in this map must be Strings. The appropriate type
095: * of each associated value depends on the attribute. The contents of environment are
096: * not changed by this call
097: * @return the JMX Connector.
098: * @throws java.io.IOException if a connection cannot be established.
099: */
100: javax.management.remote.JMXConnector getJMXConnector(
101: boolean forceNew, Map environment)
102: throws java.io.IOException;
103:
104: }
|