WebLogicHelper Class

com.beasys.commerce.axiom.util.weblogic.helper
WebLogicHelper Class

public class WebLogicHelper

    extends Object
    implements ToolkitConstants

Single point of access to the application server. This should make it easy to swap out servers, and processes.


Hierarchy
Object
  WebLogicHelper
All Implemented Interfaces

ToolkitConstants

Field Summary

protected static WebLogicHelper
cc
Singleton instance.
protected static final boolean
debug
Compile out the debug code.
protected String
serverUrl
The weblogic server url.
protected T3ServicesDef
t3Services
Handle to the Weblogic T3 client class.
 

Constructor Summary

WebLogicHelper()

Default constructor.
 

Method Summary

public void
finalize()
Destructor.
public int
getBuild()
Get the WebLogic version.
public Connection
getConnection()
Get a connection to a pooled database connection in Weblogic.
public static WebLogicHelper
getInstance()
Get the singleton instance.
public Connection
getJDBCConnection()
Get a straight JDBC connection.
public Connection
getJtsConnection()
Get connection.
public long
getNewId()
Get a unique id for a schema.
public synchronized long
getNewId(String anId)
Get a unique id for a given id.
public Object
getService(String aLookupName)
Connect to a reference in JNDI referred to by the lookup name.
public T3ServicesDef
getT3Services()
Get the services.
public TimeServicesDef
getTime()
Get the T3 time service.
protected void
init()
Init the connections to the app server.
public void
log(String aMsg)
Write to the weblogic logs, with extra information added.
public void
log(int aLevel, String aMsg)
Write to the weblogic logs, with extra information added.
public void
log(int aLevel, String appName, String aMsg)
Write to the weblogic logs, with extra information added.
public synchronized void
setupConnection()
creates a T3Client connection to the Tengah server, creates a jndi context to lookup the TRVClientServices object, and creates a TRVClient
 
Methods from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   

Field Detail

cc

protected static WebLogicHelper cc
Singleton instance.


debug

protected static final boolean debug
Compile out the debug code.


serverUrl

protected String serverUrl
The weblogic server url. something similar to t3://localhost:7001


t3Services

protected T3ServicesDef t3Services
Handle to the Weblogic T3 client class.

 

Constructor Detail

WebLogicHelper

protected WebLogicHelper()
Default constructor.
 

Method Detail

finalize() Method

public void finalize()
throws Throwable
Destructor.

Overrides
Object.finalize()

Exceptions

Throwable

getBuild() Method

DEPRECATED Services that need this should provide internal implementation

public int getBuild()
Get the WebLogic version.

Returns

the version.

getConnection() Method

DEPRECATED Use com.bea.p13n.util.jdbc.JdbcHelper.getConnection(javax.sql.DataSource, int, long)

public Connection getConnection()
throws ToolkitException, SQLException
Get a connection to a pooled database connection in Weblogic.

Returns

Connection pooled connection

Exceptions

ToolkitException
SQLException

getInstance() Method

public static WebLogicHelper getInstance()
Get the singleton instance.

Returns

WebLogicHelper

getJDBCConnection() Method

DEPRECATED Use com.bea.p13n.util.jdbc.JdbcHelper.getConnection(javax.sql.DataSource, int, long)

public Connection getJDBCConnection()
throws ToolkitException, SQLException
Get a straight JDBC connection.

Returns

Connection

Exceptions

ToolkitException
SQLException

getJtsConnection() Method

DEPRECATED Use com.bea.p13n.util.jdbc.JdbcHelper.getConnection(javax.sql.DataSource, int, long)

public Connection getJtsConnection()
throws ToolkitException, SQLException
Get connection.

Returns

Connection

Exceptions

ToolkitException
SQLException

getNewId() Method

DEPRECATED Use com.bea.p13n.util.jdbc.Sequencer and com.bea.p13n.util.jdbc.SequencerFactory

public long getNewId()
throws ToolkitException
Get a unique id for a schema.

Returns

long the new id.

Exceptions

ToolkitException

getNewId(String) Method

DEPRECATED Use com.bea.p13n.util.jdbc.Sequencer and com.bea.p13n.util.jdbc.SequencerFactory

public synchronized long getNewId(String anId)
throws ToolkitException
Get a unique id for a given id.

Parameters

anId
the table name, bean name, whatever you want to keep track of unique ids for.

Returns

long the new id.

Exceptions

ToolkitException

getService(String) Method

DEPRECATED Use com.bea.p13n.util.JndiHelper to get the Context and do the lookup.

public Object getService(String aLookupName)
throws ToolkitException
Connect to a reference in JNDI referred to by the lookup name.

Parameters

aLookupName
the lookup name.

Returns

Object the object referenced by the name. Use this to get handles to Home interfaces, RMI objects, etc.

Exceptions

ToolkitException
holder for any exception

getT3Services() Method

DEPRECATED Services that need this functionality should implement it internally, and not expose it via a public API.

public T3ServicesDef getT3Services()
Get the services. Subclasses should implement if different.


getTime() Method

DEPRECATED Services that need this functionality should implement it internally, and not expose it via a public API.

public TimeServicesDef getTime()
Get the T3 time service.

Returns

TimeServicesDef the time services.

init() Method

DEPRECATED

protected void init()
Init the connections to the app server.


log(String) Method

DEPRECATED Use Weblogic i18n message logging

public void log(String aMsg)
Write to the weblogic logs, with extra information added. The granularity is defined in the properties file.

Parameters

aMsg
the message, if null it will ignore.

log(int, String) Method

DEPRECATED Use Weblogic i18n message logging

public void log(int aLevel, 
                String aMsg)
Write to the weblogic logs, with extra information added. The granularity is defined in the properties file.

Parameters

aLevel
aLevel Possible error levels are: FrameworkConstants.LOG_DEBUG FrameworkConstants.LOG_INFO FrameworkConstants.LOG_WARNING FrameworkConstants.LOG_ERROR FrameworkConstants.LOG_FATAL FrameworkConstants.LOG_SECURITY
aMsg
the message, if null it will ignore.

log(int, String, String) Method

DEPRECATED Use Weblogic i18n message logging

public void log(int aLevel, 
                String appName, 
                String aMsg)
Write to the weblogic logs, with extra information added. The granularity is defined in the properties file.

Parameters

aLevel
aLevel Possible error levels are: FrameworkConstants.LOG_DEBUG FrameworkConstants.LOG_INFO FrameworkConstants.LOG_WARNING FrameworkConstants.LOG_ERROR FrameworkConstants.LOG_FATAL FrameworkConstants.LOG_SECURITY
appName
the name of the application logging the message
aMsg
the message, if null it will ignore.

setupConnection() Method

DEPRECATED Services that need this functionality should implement it internally, and not expose it via a public API.

public synchronized void setupConnection()
throws ToolkitException
creates a T3Client connection to the Tengah server, creates a jndi context to lookup the TRVClientServices object, and creates a TRVClient

Exceptions

ToolkitException
holder for any exception