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: * @(#)PlatformContext.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.platform;
030:
031: import com.sun.jbi.JBIProvider;
032: import com.sun.jbi.EnvironmentContext;
033: import com.sun.jbi.security.KeyStoreUtil;
034:
035: import java.util.Set;
036: import java.util.HashSet;
037: import java.util.List;
038: import java.util.Map;
039:
040: import javax.management.MBeanServerConnection;
041: import javax.management.MBeanServer;
042: import javax.management.ObjectName;
043: import javax.naming.InitialContext;
044:
045: /**
046: * This interface defines a generic way to obtain application server platform-
047: * specific information at runtime. Each platform must provide an implementation
048: * of this interface to the JBI framework.
049: *
050: * @author Sun Microsystems Inc.
051: */
052: public interface PlatformContext {
053: /**
054: * Token used in the JBI registry to account for instance-local root path.
055: */
056: public static String INSTANCE_ROOT_TOKEN = "com.sun.jbi.platform.instanceRoot";
057: /**
058: * Token used in the JBI registry to account for instance-local install
059: * root path.
060: */
061: public static String INSTALL_ROOT_TOKEN = "com.sun.jbi.platform.installRoot";
062:
063: /**
064: * Get the TransactionManager for this implementation. The instance
065: * returned is an implementation of the standard JTS interface. If none
066: * is available, returns <CODE>null</CODE>.
067: * @return a <CODE>TransactionManager</CODE> instance.
068: * @throws Exception if a <CODE>TransactionManager</CODE> cannot be obtained.
069: */
070: javax.transaction.TransactionManager getTransactionManager()
071: throws Exception;
072:
073: /**
074: * Get the MBean server connection for a particular instance.
075: * @return the <CODE>MBeanServerConnection</CODE> for the specified instance.
076: * @throws Exception if a <CODE>MBeanServerConnection</CODE> cannot be
077: * obtained.
078: */
079: MBeanServerConnection getMBeanServerConnection(String instanceName)
080: throws Exception;
081:
082: /**
083: * Get the system class loader for this implementation.
084: * @return the <CODE>ClassLoader</CODE> that is the "system" class loader
085: * from a JBI runtime perspective.
086: */
087: ClassLoader getSystemClassLoader();
088:
089: /**
090: * Get the instance name of the platform's administration server. If the
091: * platform does not provide a separate administration server, then this
092: * method returns the name of the local instance.
093: * @return instance name of the administration server
094: */
095: String getAdminServerName();
096:
097: /**
098: * Determine whether this instance is the administration server instance.
099: * @return <CODE>true</CODE> if this instance is the administration server,
100: * <CODE>false</CODE> if not.
101: */
102: boolean isAdminServer();
103:
104: /**
105: * Get the name of this instance.
106: * @return the name of this server instance.
107: */
108: String getInstanceName();
109:
110: /**
111: * Determine if the specified instance is up.
112: * @return true if the instance is up and running, false otherwise
113: */
114: boolean isInstanceUp(String instanceName);
115:
116: /**
117: * Determine whether multiple servers are permitted within this AS
118: * installation.
119: * @return true if multiple servers are permitted.
120: */
121: boolean supportsMultipleServers();
122:
123: /**
124: * Get the Target Name. If the instance is not a clustered instance then
125: * the target name is the instance name. If the instance is part of a
126: * cluster then the target name is the cluster name.
127: *
128: * @return the target name.
129: */
130: String getTargetName();
131:
132: /**
133: * Get the Target Name for a specified instance. If the instance is not
134: * clustered the instance name is returned. This operation is invoked by
135: * the JBI instance MBeans only.
136: *
137: * @return the target name.
138: */
139: String getTargetName(String instanceName);
140:
141: /**
142: * Get a set of the names of all the standalone servers in the domain.
143: * @return a set of names of standalone servers in the domain.
144: */
145: Set<String> getStandaloneServerNames();
146:
147: /**
148: * Get a set of the names of all the clustered servers in the domain.
149: * @return a set of names of clustered servers in the domain.
150: */
151: Set<String> getClusteredServerNames();
152:
153: /**
154: * Get a set of the names of all the clusters in the domain.
155: * @return a set of names of clusters in the domain.
156: */
157: Set<String> getClusterNames();
158:
159: /**
160: * Get a set of the names of all the servers in the specified cluster.
161: * @return a set of names of servers in the cluster.
162: */
163: Set<String> getServersInCluster(String clusterName);
164:
165: /**
166: * Determine whether a target is a valid server or cluster name.
167: * @return <CODE>true</CODE> if <CODE>targetName</CODE> is a valid
168: * standalone server name or cluster name, <CODE>false</CODE> if not.
169: */
170: boolean isValidTarget(String targetName);
171:
172: /**
173: * Determine whether a target is a cluster.
174: * @return <CODE>true</CODE> if <CODE>targetName</CODE> is a cluster,
175: * <CODE>false</CODE> if not.
176: */
177: boolean isCluster(String targetName);
178:
179: /**
180: * Determine whether a target is a standalone server.
181: * @return <CODE>true</CODE> if <CODE>targetName</CODE> is a standalone
182: * server, <CODE>false</CODE> if not.
183: */
184: boolean isStandaloneServer(String targetName);
185:
186: /**
187: * Determine whether the target is a clustered server.
188: * @return <CODE>true</CODE> if <CODE>targetName</CODE> is a clustered
189: * server, <CODE>false</CODE> if not.
190: */
191: boolean isClusteredServer(String targetName);
192:
193: /**
194: * Determine whether or not an instance is clustered.
195: * @return <CODE>true</CODE> if the instance is clustered,
196: * <CODE>false</CODE> if not.
197: */
198: boolean isInstanceClustered(String instanceName);
199:
200: /**
201: * Get a string representation of the DAS JMX RMI connector port.
202: * @return the JMX RMI connector port as a (CODE>String</CODE>.
203: */
204: String getJmxRmiPort();
205:
206: /**
207: * Provides access to the platform's MBean server.
208: * @return platform MBean server.
209: */
210: MBeanServer getMBeanServer();
211:
212: /**
213: * Get the full path to the platform's instance root directory.
214: * @return platform instance root
215: */
216: String getInstanceRoot();
217:
218: /**
219: * Get the full path to the platform's instaall root directory.
220: * @return platform install root
221: */
222: String getInstallRoot();
223:
224: /**
225: * Returns the provider type for this platform.
226: * @return enum value corresponding to this platform implementation.
227: */
228: JBIProvider getProvider();
229:
230: /**
231: * Retrieves the naming context that should be used to locate platform
232: * resources (e.g. TransactionManager).
233: * @return naming context
234: */
235: InitialContext getNamingContext();
236:
237: /**
238: * Register a listener for platform events.
239: * @param listener listener implementation
240: */
241: void addListener(PlatformEventListener listener);
242:
243: /**
244: * Remove a listener for platform events.
245: * @param listener listener implementation
246: */
247: void removeListener(PlatformEventListener listener);
248:
249: /**
250: * Returns a platform-specific implementation of KeyStoreUtil.
251: *
252: * @return an instance of KeyStoreUtil or null if KeyStoreUtil
253: * is not supported as part of this platform.
254: */
255: KeyStoreUtil getKeyStoreUtil();
256: }
|