001: /*
002: * @(#) TransactionContext.java
003: *
004: * JOTM: Java Open Transaction Manager
005: *
006: *
007: * This module was originally developed by
008: *
009: * - Bull S.A. as part of the JOnAS application server code released in
010: * July 1999 (www.bull.com)
011: *
012: * --------------------------------------------------------------------------
013: * The original code and portions created by Bull SA are
014: * Copyright (c) 1999 BULL SA
015: * All rights reserved.
016: *
017: * Redistribution and use in source and binary forms, with or without
018: * modification, are permitted provided that the following conditions are met:
019: *
020: * -Redistributions of source code must retain the above copyright notice, this
021: * list of conditions and the following disclaimer.
022: *
023: * -Redistributions in binary form must reproduce the above copyright notice,
024: * this list of conditions and the following disclaimer in the documentation
025: * and/or other materials provided with the distribution.
026: *
027: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
028: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
029: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
030: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
031: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
032: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
033: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
034: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
035: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
036: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
037: * POSSIBILITY OF SUCH DAMAGE.
038: *
039: * --------------------------------------------------------------------------
040: * $Id: TransactionContext.java,v 1.9 2004/12/13 19:53:06 tonyortiz Exp $
041: * --------------------------------------------------------------------------
042: */
043: package org.objectweb.jotm;
044:
045: import java.io.Serializable;
046:
047: /**
048: * This is how the JTA Implementation in JOTM sees the Transaction Context.
049: * This interface is used to keep the code independant of the transport layer
050: * this context is for internal use only (JOTM and UserTransaction) it has to
051: * be translated for each protocol.
052: *
053: * For the moment this Transaction Context is Serializable
054: * for test suite
055: *
056: * @author jmesnil
057: * @version $Id: TransactionContext.java,v 1.9 2004/12/13 19:53:06 tonyortiz Exp $
058: */
059: public interface TransactionContext extends Serializable {
060:
061: /**
062: * get transaction timeout.
063: *
064: * @return transaction timeout
065: */
066: public int getTimeout();
067:
068: /**
069: * get the Coordinator of the transaction.
070: *
071: * @return Coordinator
072: */
073: public Coordinator getCoordinator();
074:
075: /**
076: * set the Coordinator of the transaction.
077: *
078: * @param c Coordinator
079: */
080: public void setCoordinator(Coordinator c);
081:
082: /**
083: * get the Terminator of the transaction.
084: *
085: * @return Terminator
086: */
087: public Terminator getTerminator();
088:
089: /**
090: * set the Terminator of the transaction.
091: *
092: * @param t Terminator
093: */
094: public void setTerminator(Terminator t);
095:
096: /**
097: * get the Control of the Transaction.
098: *
099: * @return Control
100: */
101: public Control getControl();
102:
103: /**
104: * get the Xid of the transaction.
105: *
106: * @return Xid
107: */
108: public org.objectweb.jotm.Xid getXid();
109:
110: /**
111: * Set a flag in the context to indicate as coming from another Vendor
112: *
113: * @return boolean
114: */
115: public void setNotJotmCtx();
116:
117: /**
118: * return true if this context was build from a JOTM's context
119: *
120: * @return boolean
121: */
122: public boolean isJotmCtx();
123:
124: }
|