Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

de.danet.an.util.log4j
Class EJBSinkEJB  view EJBSinkEJB download EJBSinkEJB.java

java.lang.Object
  extended byde.danet.an.util.log4j.EJBSinkEJB
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

public class EJBSinkEJB
extends java.lang.Object
implements javax.ejb.SessionBean

This session EJB provides the server side part of the EJBAppender.


Field Summary
private  javax.ejb.SessionContext ctx
          The SessionContext interface of the instance.
private static java.lang.String DB_NAME
          Database attributes
private  javax.sql.DataSource ds
          The data source of the database.
 
Constructor Summary
EJBSinkEJB()
           
 
Method Summary
 void append(org.apache.log4j.spi.LoggingEvent event)
          Insert the event information into the database.
 void ejbActivate()
          Not called for stateless session beans.
 void ejbCreate()
          Create a new instance of the EJBSinkEJB.
 void ejbPassivate()
          Not called for stateless session beans.
 void ejbRemove()
          A container invokes this method before it ends the life of the session object.
private  void prepareDatabaseConnection()
          Prepared the database connection and the PreparedStatement for the database access.
 void setSessionContext(javax.ejb.SessionContext context)
          Set the session context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctx

private javax.ejb.SessionContext ctx
The SessionContext interface of the instance.


ds

private javax.sql.DataSource ds
The data source of the database.

See Also:
javax.sql.DataSource

DB_NAME

private static final java.lang.String DB_NAME
Database attributes

See Also:
Constant Field Values
Constructor Detail

EJBSinkEJB

public EJBSinkEJB()
Method Detail

setSessionContext

public void setSessionContext(javax.ejb.SessionContext context)
                       throws javax.ejb.EJBException
Set the session context.

Specified by:
setSessionContext in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException
Not called for stateless session beans.

Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException
Not called for stateless session beans.

Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
A container invokes this method before it ends the life of the session object. This happens as a result of a client's invoking a remove operation, or when a container decides to terminate the session object after a timeout.

Specified by:
ejbRemove in interface javax.ejb.SessionBean

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
Create a new instance of the EJBSinkEJB.


append

public void append(org.apache.log4j.spi.LoggingEvent event)
            throws java.rmi.RemoteException
Insert the event information into the database.


prepareDatabaseConnection

private void prepareDatabaseConnection()
                                throws java.sql.SQLException
Prepared the database connection and the PreparedStatement for the database access.