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

Retrieves the InstanceContext object associated with the current component instance.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public InstanceContext getInstanceContext()

Returns

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

Returns 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 

Returns

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

NoteNote 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

Returns 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 

Returns

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 service component, since service components run without client interaction.

See also

getUserName()




Jaguar.getPeerAddress()

Description

Returns 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 

Returns

The client’s IP address, or “0.0.0.0” if the client’s IP address is unavailable.

See also

getHostName()




Jaguar.getServerName()

Description

Returns the name of the server.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public static String getServerName() throws JException 

Returns

The name of the server.




Jaguar.getUserName()

Description

Returns 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 

Returns

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 service component, since service components run without client interaction.

See also

getPassword()




Jaguar.inJaguar()

Description

Tests if running inside the server.

Syntax

Package

com.sybase.jaguar.server

Class

Jaguar

public static boolean inJaguar() throws JException 

Returns

true if running inside the server, false otherwise.

Usage

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.




Jaguar.writeLog(boolean, String)

Description

Writes a message to the server’s log file.

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

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.

For information on configuring the log file used by the server, see Chapter 3, “Creating and Configuring Servers,” in the EAServer System Administration Guide.