Chapter 1 Java Classes and Interfaces


jaguar.server.Jaguar class

Description

package com.sybase.jaguar.server;public class Jaguar extends Object 

Provides utility methods for use in server-side Java code.

Constructors

None. All methods are static.

Methods


Jaguar.getInstanceContext()

Description

Retrieve the InstanceContext object associated with the current component instance.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public InstanceContext getInstanceContext()

Return Values

An InstanceContext object for the current component instance.

Usage

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.

See Also

InstanceContext, ServerBean


Jaguar.getHostName()

Description

Return the client host name for the client connection that is associated with this component instance.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public static String getHostName() throws JException 

Return Values

The client host name. The host name can be 0 length if the client software did not supply the host name.

Note   Note Java clients do not supply the client host name (there is no mechanism to retrieve the host name in Java).

See Also

getPeerAddress()


Jaguar.getPassword()

Description

Return the password for the client connection that is associated with this component instance.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public static String getPassword() throws JException 

Return Values

The client password. The password can be 0 length.

Usage

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.

See Also

getUserName()


Jaguar.getPeerAddress()

Description

Return the client host address for the client connection that is associated with this component instance.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public static String getPeerAddress() throws JException 

Return Values

The client's IP address, or "0.0.0.0" if the client's IP address is unavailable.

See Also

getHostName()


Jaguar.getServerName()

Description

Return the name of the server.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public static String getServerName() throws JException 

Return Values

The name of the server.


Jaguar.getUserName()

Description

Return the user name for the client connection that is associated with this component instance.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public static String getUserName() throws JException 

Return Values

The user name. The user name can be 0 length.

Usage

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.

See Also

getPassword()


Jaguar.writeLog(boolean, String)

Description

Write a message to the server's log file.

Note   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.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public static native void writeLog 
(boolean use_date, String logmsg)
throws JException

Parameters

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.

Usage

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.