db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian McCallister <mccallis...@forthillcompany.com>
Subject Re: cvs commit: db-ojb/src/jca/org/apache/ojb/otm/connector OTMJCAConnection.java OTMJCAManagedConnection.java
Date Wed, 24 Sep 2003 12:52:10 GMT
Ack, sorry for the reformat whacking the useful changelist in this one.

-Brian

>   Index: OTMJCAManagedConnection.java
>   ===================================================================
>   RCS file:  
> /home/cvs/db-ojb/src/jca/org/apache/ojb/otm/connector/ 
> OTMJCAManagedConnection.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- OTMJCAManagedConnection.java	28 Aug 2003 21:30:32 -0000	1.4
>   +++ OTMJCAManagedConnection.java	23 Sep 2003 22:20:36 -0000	1.5
>   @@ -61,11 +61,21 @@
>
>    public class OTMJCAManagedConnection implements ManagedConnection,  
> LocalTransaction
>    {
>   -	private PBKey m_pbKey;
>   -	private OTMJCAManagedConnectionFactory m_managedConnectionFactory;
>   -	private PrintWriter m_logWriter;
>   -	private boolean m_destroyed;
>   -	private final Set m_handles = new HashSet();
>   -	private final Collection m_connectionEventListeners = new  
> ArrayList();
>   -	private boolean m_managed = false;
>   -	/**
>   -	 * the wrapped connection
>   -	 */
>   -	private OTMConnection m_connection;
>   -	private Transaction m_tx;
>   -
>   -	OTMJCAManagedConnection(ManagedConnectionFactory mcf,  
> OTMConnection conn, PBKey pbKey)
>   -	{
>   -		Util.log("In OTMJCAManagedConnection");
>   -		m_managedConnectionFactory = (OTMJCAManagedConnectionFactory) mcf;
>   -		m_pbKey = pbKey;
>   -		m_connection = conn;
>   -	}
>   -
>   -	/**
>   -	 * get the underlying wrapped connection
>   -	 * @return OTMConnection raw connection to the OTM.
>   -	 */
>   -	OTMConnection getConnection()
>   -	{
>   -		if (m_connection == null)
>   -		{
>   -			OTMConnectionRuntimeException ex = new  
> OTMConnectionRuntimeException("Connection is null.");
>   -			sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   -		}
>   -		return m_connection;
>   -	}
>   -
>   -	public String getUserName()
>   -	{
>   -		return m_pbKey.getUser();
>   -	}
>   -
>   -	public Object getConnection(Subject subject, ConnectionRequestInfo  
> connectionRequestInfo)
>   -			throws ResourceException
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.getConnection");
>   -		OTMJCAConnection myCon = new OTMJCAConnection(this);
>   -		synchronized (m_handles)
>   -		{
>   -			m_handles.add(myCon);
>   -		}
>   -		return myCon;
>   -	}
>   -
>   -	public void destroy()
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.destroy");
>   -		cleanup();
>   -		m_connection.close();
>   -		m_destroyed = true;
>   -	}
>   -
>   -	public void cleanup()
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.cleanup");
>   -		synchronized (m_handles)
>   -		{
>   -			for (Iterator i = m_handles.iterator(); i.hasNext();)
>   -			{
>   -				OTMJCAConnection lc = (OTMJCAConnection) i.next();
>   -				lc.setManagedConnection(null);
>   -			}
>   -			m_handles.clear();
>   -		}
>   -	}
>   -
>   -	void closeHandle(OTMJCAConnection handle)
>   -	{
>   -		synchronized (m_handles)
>   -		{
>   -			m_handles.remove(handle);
>   -		}
>   -		sendEvents(ConnectionEvent.CONNECTION_CLOSED, null, handle);
>   -	}
>   -
>   -	public void associateConnection(Object connection)
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.associateConnection");
>   -		if (connection == null)
>   -		{
>   -			throw new OTMConnectionRuntimeException("Cannot associate a null  
> connection");
>   -		}
>   -		if (!(connection instanceof OTMJCAConnection))
>   -		{
>   -			throw new OTMConnectionRuntimeException("Cannot associate a  
> connection of type: " + connection.getClass().getName() + " to a  
> handle that manages: " + OTMJCAConnection.class.getName());
>   -		}
>   -		((OTMJCAConnection) connection).setManagedConnection(this);
>   -		synchronized (m_handles)
>   -		{
>   -			m_handles.add(connection);
>   -		}
>   -	}
>   -
>   -	public void addConnectionEventListener(ConnectionEventListener cel)
>   -	{
>   -		synchronized (m_connectionEventListeners)
>   -		{
>   -			m_connectionEventListeners.add(cel);
>   -		}
>   -	}
>   -
>   -	public void removeConnectionEventListener(ConnectionEventListener  
> cel)
>   -	{
>   -		synchronized (m_connectionEventListeners)
>   -		{
>   -			m_connectionEventListeners.remove(cel);
>   -		}
>   -	}
>   -
>   -	public XAResource getXAResource()
>   -			throws ResourceException
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.getXAResource");
>   -		throw new NotSupportedException("public XAResource  
> getXAResource() not supported in this release.");
>   -	}
>   -
>   -	/**
>   -	 * the OTMConnection is the transaction
>   -	 * @return
>   -	 */
>   -	public LocalTransaction getLocalTransaction()
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.getLocalTransaction");
>   -		return this;
>   -	}
>   -
>   -	public ManagedConnectionMetaData getMetaData()
>   -			throws ResourceException
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.getMetaData");
>   -		return new OTMConnectionMetaData(this);
>   -	}
>   -
>   -	public void setLogWriter(PrintWriter out)
>   -			throws ResourceException
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.setLogWriter");
>   -		m_logWriter = out;
>   -	}
>   -
>   -	public PrintWriter getLogWriter()
>   -			throws ResourceException
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.getLogWriter");
>   -		return m_logWriter;
>   -	}
>   -
>   -	boolean isDestroyed()
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.isDestroyed");
>   -		return m_destroyed;
>   -	}
>   -
>   -	ManagedConnectionFactory getManagedConnectionFactory()
>   -	{
>   -		Util.log("In  
> OTMJCAManagedConnection.getManagedConnectionFactory");
>   -		return m_managedConnectionFactory;
>   -	}
>   -
>   -	public void begin() throws ResourceException
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.begin");
>   -		if (!isManaged())
>   -		{
>   -			try
>   -			{
>   -				m_tx =  
> m_managedConnectionFactory.getKit().getTransaction(m_connection);
>   -				m_tx.begin();
>   -				setManaged(true);
>   -			}
>   -			catch (TransactionException e)
>   -			{
>   -				ResourceException ex = new ResourceException(e.getMessage());
>   -				sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   -				throw ex;
>   -			}
>   -		}
>   -		else
>   -		{
>   -			ResourceException ex = new ResourceException("You probably  
> called begin again without calling Commit or Rollback, OTM does not  
> support nested Local Transactions.");
>   -			sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   -			throw ex;
>   -		}
>   -	}
>   -
>   -	public void commit() throws ResourceException
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.commit");
>   -		if (isManaged())
>   -		{
>   -			try
>   -			{
>   -				setManaged(false);
>   -				m_tx.commit();
>   -			}
>   -			catch (TransactionException e)
>   -			{
>   -				m_tx.rollback();
>   -				ResourceException ex = new ResourceException(e.getMessage());
>   -				sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   -				throw ex;
>   -			}
>   -		}
>   -		else
>   -		{
>   -			ResourceException ex = new ResourceException("Cannot call commit  
> when you are not in a Local Transaction.");
>   -			sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   -			throw ex;
>   -		}
>   -	}
>   -
>   -	public void rollback() throws ResourceException
>   -	{
>   -		Util.log("In OTMJCAManagedConnection.rollback");
>   -		if (isManaged())
>   -		{
>   -			try
>   -			{
>   -				m_tx.rollback();
>   -				setManaged(false);
>   -			}
>   -			catch (TransactionException e)
>   -			{
>   -				ResourceException ex = new ResourceException(e.getMessage());
>   -				sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   -				throw ex;
>   -			}
>   -		}
>   -		else
>   -		{
>   -			ResourceException ex = new ResourceException("Cannot call  
> rollback when you are not in a Local Transaction.");
>   -			sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   -			throw ex;
>   -		}
>   -	}
>   -
>   -	private boolean isManaged()
>   -	{
>   -		return m_managed;
>   -	}
>   -
>   -	private void setManaged(boolean flag)
>   -	{
>   -		m_managed = flag;
>   -	}
>   -
>   -	/**
>   -	 * Section 6.5.6 of the JCA 1.5 spec instructs ManagedConnection  
> instances to notify connection listeners with
>   -	 * close/error and local transaction-related events to its  
> registered set of listeners.
>   -	 *
>   -	 * The events for begin/commit/rollback are only sent if the  
> application server did NOT
>   -	 * initiate the actions.
>   -	 *
>   -	 * This method dispatchs all events to the listeners based on the  
> eventType
>   -	 * @param eventType as enumerated in the ConnectionEvents interface
>   -	 * @param ex an optional exception if we are sending an error  
> message
>   -	 * @param connectionHandle an optional connectionHandle if we have  
> access to it.
>   -	 */
>   -	void sendEvents(int eventType, Exception ex, Object  
> connectionHandle)
>   -	{
>   -		ConnectionEvent ce = null;
>   -		if (ex == null)
>   -		{
>   -			ce = new ConnectionEvent(this, eventType);
>   -		}
>   -		else
>   -		{
>   -			ce = new ConnectionEvent(this, eventType, ex);
>   -		}
>   -		ce.setConnectionHandle(connectionHandle);
>   -		Collection copy = null;
>   -		synchronized (m_connectionEventListeners)
>   -		{
>   -			copy = new ArrayList(m_connectionEventListeners);
>   -		}
>   -		switch (ce.getId())
>   -		{
>   -			case ConnectionEvent.CONNECTION_CLOSED:
>   -				for (Iterator i = copy.iterator(); i.hasNext();)
>   -				{
>   -					ConnectionEventListener cel = (ConnectionEventListener)  
> i.next();
>   -					cel.connectionClosed(ce);
>   -				}
>   -				break;
>   -			case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
>   -				for (Iterator i = copy.iterator(); i.hasNext();)
>   -				{
>   -					ConnectionEventListener cel = (ConnectionEventListener)  
> i.next();
>   -					cel.localTransactionStarted(ce);
>   -				}
>   -				break;
>   -			case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
>   -				for (Iterator i = copy.iterator(); i.hasNext();)
>   -				{
>   -					ConnectionEventListener cel = (ConnectionEventListener)  
> i.next();
>   -					cel.localTransactionCommitted(ce);
>   -				}
>   -				break;
>   -			case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
>   -				for (Iterator i = copy.iterator(); i.hasNext();)
>   -				{
>   -					ConnectionEventListener cel = (ConnectionEventListener)  
> i.next();
>   -					cel.localTransactionRolledback(ce);
>   -				}
>   -				break;
>   -			case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
>   -				for (Iterator i = copy.iterator(); i.hasNext();)
>   -				{
>   -					ConnectionEventListener cel = (ConnectionEventListener)  
> i.next();
>   -					cel.connectionErrorOccurred(ce);
>   -				}
>   -				break;
>   -			default:
>   -				throw new IllegalArgumentException("Illegal eventType: " +  
> ce.getId());
>   -		}
>   -	}
>   +    private PBKey m_pbKey;
>   +    private OTMJCAManagedConnectionFactory  
> m_managedConnectionFactory;
>   +    private PrintWriter m_logWriter;
>   +    private boolean m_destroyed;
>   +    private final Set m_handles = new HashSet();
>   +    private final Collection m_connectionEventListeners = new  
> ArrayList();
>   +    private boolean m_managed = false;
>   +    /**
>   +     * the wrapped connection
>   +     */
>   +    private OTMConnection m_connection;
>   +    private Transaction m_tx;
>   +
>   +    OTMJCAManagedConnection(ManagedConnectionFactory mcf,  
> OTMConnection conn, PBKey pbKey)
>   +    {
>   +        Util.log("In OTMJCAManagedConnection");
>   +        m_managedConnectionFactory =  
> (OTMJCAManagedConnectionFactory) mcf;
>   +        m_pbKey = pbKey;
>   +        m_connection = conn;
>   +    }
>   +
>   +    /**
>   +     * get the underlying wrapped connection
>   +     * @return OTMConnection raw connection to the OTM.
>   +     */
>   +    OTMConnection getConnection()
>   +    {
>   +        if (m_connection == null)
>   +        {
>   +            OTMConnectionRuntimeException ex = new  
> OTMConnectionRuntimeException("Connection is null.");
>   +            sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED,  
> ex, null);
>   +        }
>   +        return m_connection;
>   +    }
>   +
>   +    public Transaction getTransaction()
>   +    {
>   +        return this.m_tx;
>   +    }
>   +
>   +    public void setTransaction(Transaction tx)
>   +    {
>   +        if (this.m_tx != null) throw new  
> IllegalStateException("Connection already has Transaction");
>   +        this.m_tx = tx;
>   +    }
>   +
>   +    public String getUserName()
>   +    {
>   +        return m_pbKey.getUser();
>   +    }
>   +
>   +    public Object getConnection(Subject subject,  
> ConnectionRequestInfo connectionRequestInfo)
>   +            throws ResourceException
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.getConnection");
>   +        OTMJCAConnection myCon = new OTMJCAConnection(this);
>   +        synchronized (m_handles)
>   +        {
>   +            m_handles.add(myCon);
>   +        }
>   +        return myCon;
>   +    }
>   +
>   +    public void destroy()
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.destroy");
>   +        cleanup();
>   +        m_connection.close();
>   +        m_destroyed = true;
>   +    }
>   +
>   +    public void cleanup()
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.cleanup");
>   +        synchronized (m_handles)
>   +        {
>   +            for (Iterator i = m_handles.iterator(); i.hasNext();)
>   +            {
>   +                OTMJCAConnection lc = (OTMJCAConnection) i.next();
>   +                lc.setManagedConnection(null);
>   +            }
>   +            m_handles.clear();
>   +        }
>   +    }
>   +
>   +    void closeHandle(OTMJCAConnection handle)
>   +    {
>   +        synchronized (m_handles)
>   +        {
>   +            m_handles.remove(handle);
>   +        }
>   +        sendEvents(ConnectionEvent.CONNECTION_CLOSED, null, handle);
>   +    }
>   +
>   +    public void associateConnection(Object connection)
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.associateConnection");
>   +        if (connection == null)
>   +        {
>   +            throw new OTMConnectionRuntimeException("Cannot  
> associate a null connection");
>   +        }
>   +        if (!(connection instanceof OTMJCAConnection))
>   +        {
>   +            throw new OTMConnectionRuntimeException("Cannot  
> associate a connection of type: " + connection.getClass().getName() +  
> " to a handle that manages: " + OTMJCAConnection.class.getName());
>   +        }
>   +        ((OTMJCAConnection) connection).setManagedConnection(this);
>   +        synchronized (m_handles)
>   +        {
>   +            m_handles.add(connection);
>   +        }
>   +    }
>   +
>   +    public void addConnectionEventListener(ConnectionEventListener  
> cel)
>   +    {
>   +        synchronized (m_connectionEventListeners)
>   +        {
>   +            m_connectionEventListeners.add(cel);
>   +        }
>   +    }
>   +
>   +    public void  
> removeConnectionEventListener(ConnectionEventListener cel)
>   +    {
>   +        synchronized (m_connectionEventListeners)
>   +        {
>   +            m_connectionEventListeners.remove(cel);
>   +        }
>   +    }
>   +
>   +    public XAResource getXAResource()
>   +            throws ResourceException
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.getXAResource");
>   +        throw new NotSupportedException("public XAResource  
> getXAResource() not supported in this release.");
>   +    }
>   +
>   +    /**
>   +     * the OTMConnection is the transaction
>   +     * @return
>   +     */
>   +    public LocalTransaction getLocalTransaction()
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.getLocalTransaction");
>   +        return this;
>   +    }
>   +
>   +    public ManagedConnectionMetaData getMetaData()
>   +            throws ResourceException
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.getMetaData");
>   +        return new OTMConnectionMetaData(this);
>   +    }
>   +
>   +    public void setLogWriter(PrintWriter out)
>   +            throws ResourceException
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.setLogWriter");
>   +        m_logWriter = out;
>   +    }
>   +
>   +    public PrintWriter getLogWriter()
>   +            throws ResourceException
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.getLogWriter");
>   +        return m_logWriter;
>   +    }
>   +
>   +    boolean isDestroyed()
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.isDestroyed");
>   +        return m_destroyed;
>   +    }
>   +
>   +    ManagedConnectionFactory getManagedConnectionFactory()
>   +    {
>   +        Util.log("In  
> OTMJCAManagedConnection.getManagedConnectionFactory");
>   +        return m_managedConnectionFactory;
>   +    }
>   +
>   +    public void begin() throws ResourceException
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.begin");
>   +        if (!isManaged())
>   +        {
>   +            try
>   +            {
>   +                m_tx =  
> m_managedConnectionFactory.getKit().getTransaction(m_connection);
>   +                m_tx.begin();
>   +                setManaged(true);
>   +            }
>   +            catch (TransactionException e)
>   +            {
>   +                ResourceException ex = new  
> ResourceException(e.getMessage());
>   +                 
> sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   +                throw ex;
>   +            }
>   +        }
>   +        else
>   +        {
>   +            ResourceException ex = new ResourceException("You  
> probably called begin again without calling Commit or Rollback, OTM  
> does not support nested Local Transactions.");
>   +            sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED,  
> ex, null);
>   +            throw ex;
>   +        }
>   +    }
>   +
>   +    public void commit() throws ResourceException
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.commit");
>   +        if (isManaged())
>   +        {
>   +            try
>   +            {
>   +                setManaged(false);
>   +                m_tx.commit();
>   +            }
>   +            catch (TransactionException e)
>   +            {
>   +                m_tx.rollback();
>   +                ResourceException ex = new  
> ResourceException(e.getMessage());
>   +                 
> sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   +                throw ex;
>   +            }
>   +        }
>   +        else
>   +        {
>   +            ResourceException ex = new ResourceException("Cannot  
> call commit when you are not in a Local Transaction.");
>   +            sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED,  
> ex, null);
>   +            throw ex;
>   +        }
>   +    }
>   +
>   +    public void rollback() throws ResourceException
>   +    {
>   +        Util.log("In OTMJCAManagedConnection.rollback");
>   +        if (isManaged())
>   +        {
>   +            try
>   +            {
>   +                m_tx.rollback();
>   +                setManaged(false);
>   +            }
>   +            catch (TransactionException e)
>   +            {
>   +                ResourceException ex = new  
> ResourceException(e.getMessage());
>   +                 
> sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED, ex, null);
>   +                throw ex;
>   +            }
>   +        }
>   +        else
>   +        {
>   +            ResourceException ex = new ResourceException("Cannot  
> call rollback when you are not in a Local Transaction.");
>   +            sendEvents(ConnectionEvent.CONNECTION_ERROR_OCCURRED,  
> ex, null);
>   +            throw ex;
>   +        }
>   +    }
>   +
>   +    private boolean isManaged()
>   +    {
>   +        return m_managed;
>   +    }
>   +
>   +    private void setManaged(boolean flag)
>   +    {
>   +        m_managed = flag;
>   +    }
>   +
>   +    /**
>   +     * Section 6.5.6 of the JCA 1.5 spec instructs  
> ManagedConnection instances to notify connection listeners with
>   +     * close/error and local transaction-related events to its  
> registered set of listeners.
>   +     *
>   +     * The events for begin/commit/rollback are only sent if the  
> application server did NOT
>   +     * initiate the actions.
>   +     *
>   +     * This method dispatchs all events to the listeners based on  
> the eventType
>   +     * @param eventType as enumerated in the ConnectionEvents  
> interface
>   +     * @param ex an optional exception if we are sending an error  
> message
>   +     * @param connectionHandle an optional connectionHandle if we  
> have access to it.
>   +     */
>   +    void sendEvents(int eventType, Exception ex, Object  
> connectionHandle)
>   +    {
>   +        ConnectionEvent ce = null;
>   +        if (ex == null)
>   +        {
>   +            ce = new ConnectionEvent(this, eventType);
>   +        }
>   +        else
>   +        {
>   +            ce = new ConnectionEvent(this, eventType, ex);
>   +        }
>   +        ce.setConnectionHandle(connectionHandle);
>   +        Collection copy = null;
>   +        synchronized (m_connectionEventListeners)
>   +        {
>   +            copy = new ArrayList(m_connectionEventListeners);
>   +        }
>   +        switch (ce.getId())
>   +        {
>   +            case ConnectionEvent.CONNECTION_CLOSED:
>   +                for (Iterator i = copy.iterator(); i.hasNext();)
>   +                {
>   +                    ConnectionEventListener cel =  
> (ConnectionEventListener) i.next();
>   +                    cel.connectionClosed(ce);
>   +                }
>   +                break;
>   +            case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
>   +                for (Iterator i = copy.iterator(); i.hasNext();)
>   +                {
>   +                    ConnectionEventListener cel =  
> (ConnectionEventListener) i.next();
>   +                    cel.localTransactionStarted(ce);
>   +                }
>   +                break;
>   +            case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
>   +                for (Iterator i = copy.iterator(); i.hasNext();)
>   +                {
>   +                    ConnectionEventListener cel =  
> (ConnectionEventListener) i.next();
>   +                    cel.localTransactionCommitted(ce);
>   +                }
>   +                break;
>   +            case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
>   +                for (Iterator i = copy.iterator(); i.hasNext();)
>   +                {
>   +                    ConnectionEventListener cel =  
> (ConnectionEventListener) i.next();
>   +                    cel.localTransactionRolledback(ce);
>   +                }
>   +                break;
>   +            case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
>   +                for (Iterator i = copy.iterator(); i.hasNext();)
>   +                {
>   +                    ConnectionEventListener cel =  
> (ConnectionEventListener) i.next();
>   +                    cel.connectionErrorOccurred(ce);
>   +                }
>   +                break;
>   +            default:
>   +                throw new IllegalArgumentException("Illegal  
> eventType: " + ce.getId());
>   +        }
>   +    }
>    }
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message