package com.sybase.jaguar.server; public class Jaguar extends Object
Provides utility methods for use in server-side Java code.
None. All methods are static.
getInstanceContext() – Returns the InstanceContext object associated with the current component instance.
getHostName() – Returns the client host name for the client connection that is associated with this component instance.
getPassword() – Returns the password for the client connection that is associated with this component instance.
getPeerAddress() – Returns the client host address for the client connection that is associated with this component instance.
getServerName() – Returns the name of the server.
getUserName() – Returns the user name for the client connection that is associated with this component instance.
inJaguar() – Tests if running inside the server.
writeLog(boolean, String) – Writes a message to the server’s log file.
Retrieves the InstanceContext object associated with the current component instance.
Package |
|
Class |
public InstanceContext getInstanceContext()
An InstanceContext object for the current component instance.
Components that do not implement the ServerBean interface can call this method to get an InstanceContext object. The InstanceContext provides transaction primitives that allow the component to influence the outcome of the transactions in which it participates.
Components that implement InstanceContext receive the InstanceContext via the ServerBean.activate(InstanceContext, String) method.
Returns the client host name for the client connection that is associated with this component instance.
Package |
|
Class |
public static String getHostName() throws JException
The client host name. The host name can be 0 length if the client software did not supply the host name.
Note Java clients do not supply the client host name (there is no mechanism to retrieve the host name in Java).
Returns the password for the client connection that is associated with this component instance.
Package |
|
Class |
public static String getPassword() throws JException
The client password. The password can be 0 length.
getPassword returns the password for the client connection that is associated with this component instance.
This method cannot be called from a component instance that is running as a service component, since service components run without client interaction.
Returns the client host address for the client connection that is associated with this component instance.
Package |
|
Class |
public static String getPeerAddress() throws JException
The client’s IP address, or “0.0.0.0” if the client’s IP address is unavailable.
Returns the name of the server.
Package |
|
Class |
public static String getServerName() throws JException
The name of the server.
Returns the user name for the client connection that is associated with this component instance.
Package |
|
Class |
public static String getUserName() throws JException
The user name. The user name can be 0 length.
getUserName returns the user name for the client connection that is associated with this component instance.
This method cannot be called from a component instance that is running as a service component, since service components run without client interaction.
Tests if running inside the server.
Package |
|
Class |
public static boolean inJaguar() throws JException
true if running inside the server, false otherwise.
As an alternative, you can call the method com.sybase.CORBA.ORB.isClient(), which returns a boolean value that is true if running outside of EAServer. Use this alternative if your code may be run without the EAServer server-side classes in the CLASSPATH.
Writes a message to the server’s log file.
Standard output redirected to the server log Prehistoric EAServer versions required you to call this method to write to the log. In version 3.0 or later, you can call any of the System.out.print methods.
Package |
|
Class |
public static native void writeLog (boolean use_date, String logmsg) throws JException
true
if the
current date and time should be prepended to the log message; false
otherwise.
A message to be written to the server’s log file.
This method records a message in the server’s log file.
By convention, errors that occur on the server are written to the log. Java components should call writeLog(String) rather than printing to the console with java.lang.System.out or java.lang.System.err.
For information on configuring the log file used by the server, see Chapter 3, “Creating and Configuring Servers,” in the EAServer System Administration Guide.
Copyright © 2005. Sybase Inc. All rights reserved. |