Adobe 38000382 - Macromedia JRun - Mac Manual page 74

Jrun sdk guide
Table of Contents

Advertisement

Attribute
useAdminServer
method
server
The following example prints a table of servers on the localhost and invokes the
Example
listServerPortsUsed
...
<%@ page import="javax.naming.Context, java.util.*"%>
<% String host = "localhost"; %>
<jmcmgmt:getServersOnHost host="<%=host%>" id="servers"/>
<%-- returns a java.util.List of servers --%>
<TABLE border=1>
<TR>
<% for (int i=0; i<servers.size(); i++) { %>
<% } // end outer for loop %>
</TABLE>
...
60
Chapter 6 Using the JMC Custom Tag Library
Description
Set to true in conjunction with specifying the server attribute to
access the JRunAdminService on the first running server detected on
the same host.
Specifies the method to invoke on the specified server or host.
If only server is specified and useAdminService is set to true, then
the JRunAdminService is accessed on the next running server
detected on the same host as the specified server (in other words, any
other server).
method to get the ports that those servers use:
<TH>Server Name</TH><TH>Ports Used</TH>
<TR>
<TD valign=top>
<% String serverName = (String)servers.get(i); %><B><%= serverName %></B>
</TD>
<jmcmgmt:getServer name="<%= serverName %>" id="serverObj"/>
<jmcmgmt:invoke host="localhost" method="listServerPortsUsed" id="svrPorts"
errorId="error" type="int[]" useAdminServer="false" >
<jmcmgmt:parameter value="<%= serverName %>"/>
</jmcmgmt:invoke>
<TD>
<% if (error == null) {
for (int j = 0; j < svrPorts.length; j++) {
out.println(String.valueOf(svrPorts[j]) + "<BR>");
}
} else {
error.printStackTrace();
} // end if-else statement %>
</TD>
</TR>

Advertisement

Table of Contents
loading

This manual is also suitable for:

Macromedia jrun 4

Table of Contents