Methods Summary |
---|
public void | disable(java.lang.String appId, java.lang.String endpoint)Disables message trace for the given web service endpoint. This
method is called to dynamically reconfigure the size.
ApplicationMediator am = (ApplicationMediator) _applications.get(appId);
if (am != null) {
am.disable(endpoint);
if (am.isEmpty()) {
_applications.remove(appId);
}
} else {
String msg = _stringMgr.getString("MessageTraceMgr_InvalidAppEx",
appId, endpoint);
throw new MessageTraceException(msg);
}
|
public void | enable(java.lang.String appId, java.lang.String endpoint, int size)Enables message visualization for the given webservice endpoint.
ApplicationMediator am = (ApplicationMediator) _applications.get(appId);
if (am != null) {
am.enable(endpoint, size);
} else {
am = new ApplicationMediator(appId);
am.enable(endpoint, size);
_applications.put(appId, am);
}
|
public static com.sun.enterprise.admin.wsmgmt.msg.MessageTraceMgr | getInstance()Returns the singleton instance of this class.
return _instance;
|
public com.sun.appserv.management.ext.wsmgmt.MessageTrace[] | getMessages()Returns the available messages.
Collection c = new ArrayList();
Collection mediators = _applications.values();
for (Iterator itr=mediators.iterator(); itr.hasNext();) {
ApplicationMediator am = (ApplicationMediator) itr.next();
c.addAll( am.getMessages() );
}
MessageTrace[] trace = new MessageTrace[c.size()];
return ((MessageTrace[]) c.toArray(trace));
|
public com.sun.appserv.management.ext.wsmgmt.MessageTrace[] | getMessages(java.lang.String appId, java.lang.String endpoint)Returns messages for a web service endpoint.
Collection c = null;
ApplicationMediator am = (ApplicationMediator) _applications.get(appId);
if (am != null) {
c = am.getMessages(endpoint);
}
MessageTrace[] trace = null;
if ( c != null) {
trace = new MessageTrace[c.size()];
return ((MessageTrace[]) c.toArray(trace));
} else {
return null;
}
|
public void | init()Initializes the message visualization service.
try {
ConfigFactory cf = ConfigFactory.getConfigFactory();
ConfigProvider cp = cf.getConfigProvider();
List list = cp.getManagedWebserviceApplicationIds();
for (Iterator iter=list.iterator(); iter.hasNext();) {
String appId = (String) iter.next();
try {
ApplicationMediator am = new ApplicationMediator(appId);
_applications.put(appId, am);
} catch (MessageTraceException me) {
String msg="Initialization error for application: " + appId;
_logger.log(Level.FINE, msg, me);
}
}
} catch (Exception e) {
String msg="Configuration initialization error.";
_logger.log(Level.FINE, msg, e);
}
|
public void | setMessageHistorySize(java.lang.String appId, java.lang.String endpoint, int size)Sets the number of messages stored in memory. This method is
called to dynamically reconfigure the size.
ApplicationMediator am = (ApplicationMediator) _applications.get(appId);
if (am != null) {
am.setMessageHistorySize(endpoint, size);
} else {
String msg = _stringMgr.getString("MessageTraceMgr_InvalidAppEx",
appId, endpoint);
throw new MessageTraceException(msg);
}
|
public void | stop()Shuts down message visualization.
Collection mediators = _applications.values();
for (Iterator itr=mediators.iterator(); itr.hasNext();) {
ApplicationMediator am = (ApplicationMediator) itr.next();
am.destroy();
}
_applications.clear();
|