KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tm > remoting > interfaces > TxPropagationContext


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.tm.remoting.interfaces;
23
24 import java.io.Serializable JavaDoc;
25
26
27 /**
28  * The <code>TransactionFactory</code> operations return instances of this
29  * class, which defines the transaction context to be propagated along with
30  * outgoing invocations issued through the remoting framework. In the IIOP
31  * case, however, the transaction context is not propagated as a
32  * <code>TxPropagationContext</code> instance, but in the standard format
33  * defined by the CORBA Transaction Service specification.
34  *
35  * @author <a HREF="mailto:reverbel@ime.usp.br">Francisco Reverbel</a>
36  * @version $Revision: 37459 $
37  */

38 public class TxPropagationContext implements Serializable JavaDoc
39 {
40    static final long serialVersionUID = 88513087659796235L;
41
42    private static String JavaDoc thisClassName;
43    
44    static {
45       thisClassName = TxPropagationContext.class.getName();
46       thisClassName =
47          thisClassName.substring(thisClassName.lastIndexOf('.') + 1);
48    }
49    
50    public int formatId;
51    public byte[] globalId;
52    public int timeout;
53    public Coordinator coordinator;
54    public Terminator JavaDoc terminator;
55    
56    public TxPropagationContext(int formatId,
57                                 byte[] globalId,
58                                 int timeout,
59                                 Coordinator coordinator,
60                                 Terminator JavaDoc terminator)
61                                 
62    {
63       this.formatId = formatId;
64       this.globalId = globalId;
65       this.timeout = timeout;
66       this.coordinator = coordinator;
67       this.terminator = terminator;
68    }
69    
70    public TxPropagationContext(int formatId,
71                                 byte[] globalId,
72                                 int timeout,
73                                 Coordinator coordinator)
74    {
75       this(formatId, globalId, timeout, coordinator, null);
76    }
77    
78    public String JavaDoc toString()
79    {
80       return thisClassName + "[formatId=" + formatId
81             + ", globalId=" + new String JavaDoc(globalId).trim()
82             + ", timeout=" + timeout + "]";
83    }
84
85 }
86
Popular Tags