Chapter 1 Java Classes and Interfaces
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.
Retrieve 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.
Return 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).
Return 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 Jaguar service, since services run without client interaction.
Return 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.
Return the name of the server.
Package |
|
Class |
public static String getServerName() throws JException
The name of the server.
Return 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 Jaguar service, since services run without client interaction.
Write a message to the server's log file.
Standard output redirected to the server log
Older Jaguar releases 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
use_date
true
if the
current date and time should be prepended to the log message; false
otherwise.
logmsg
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.
The default log file name is srv.log; it can be changed in the Debug/Trace tab of the server's property sheet. For instructions on accessing the property sheet, see "Jaguar Configuration" in the Jaguar CTS System Administration Guide.
Copyright © 2000 Sybase, Inc. All rights reserved. |
![]() |