diff options
| author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 23:20:01 +0000 |
|---|---|---|
| committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 23:20:01 +0000 |
| commit | 3b3101d8b5ae4f08a16c0b7111da6cad41bbd282 (patch) | |
| tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java | |
| parent | 7e55c49d7d91ef9f09e93c1100119b1ab3652446 (diff) | |
| download | ppe42-gcc-3b3101d8b5ae4f08a16c0b7111da6cad41bbd282.tar.gz ppe42-gcc-3b3101d8b5ae4f08a16c0b7111da6cad41bbd282.zip | |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java')
| -rw-r--r-- | libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java | 88 |
1 files changed, 70 insertions, 18 deletions
diff --git a/libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java b/libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java index 29a8ea8ac77..78519510cb7 100644 --- a/libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java +++ b/libjava/classpath/gnu/CORBA/GIOP/ServiceContext.java @@ -38,8 +38,8 @@ exception statement from your version. */ package gnu.CORBA.GIOP; -import gnu.CORBA.CDR.cdrInput; -import gnu.CORBA.CDR.cdrOutput; +import gnu.CORBA.CDR.AbstractCdrInput; +import gnu.CORBA.CDR.AbstractCdrOutput; import org.omg.CORBA.BAD_INV_ORDER; import org.omg.CORBA.BAD_PARAM; @@ -48,7 +48,7 @@ import org.omg.CORBA.portable.IDLEntity; /** * Contains the ORB service data being passed. - * + * * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) */ public class ServiceContext @@ -59,6 +59,50 @@ public class ServiceContext */ private static final long serialVersionUID = 1; + /* Standard values for the context_id. */ + public static final int TransactionService = 0; + + /** + * Defines code sets, used to encode wide and narrow characters. Required for + * messages with data structures, involving wide characters. + */ + public static final int CodeSets = 1; + + public static final int ChainBypassCheck = 2; + + public static final int ChainBypassInfo = 3; + + public static final int LogicalThreadId = 4; + + public static final int BI_DIR_IIOP = 5; + + public static final int SendingContextRunTime = 6; + + public static final int INVOCATION_POLICIES = 7; + + public static final int FORWARDED_IDENTITY = 8; + + /** + * Contains exception details if exception being transferred is other than + * System or User exception. javax.rmi uses this context to transfer arbitrary + * java exceptions as CORBA value types. + */ + public static final int UnknownExceptionInfo = 9; + + public static final int RTCorbaPriority = 10; + + public static final int RTCorbaPriorityRange = 11; + + public static final int FT_GROUP_VERSION = 12; + + public static final int FT_REQUEST = 13; + + public static final int ExceptionDetailMessage = 14; + + public static final int SecurityAttributeService = 15; + + public static final int ActivityService = 16; + /** * The context id (for instance, 0x1 for code sets context). At the moment of * writing, the OMG defines 16 standard values and provides rules to register @@ -90,18 +134,18 @@ public class ServiceContext /** * Read the context values from the stream. - * + * * @param istream a stream to read from. */ - public static ServiceContext read(cdrInput istream) + public static ServiceContext read(AbstractCdrInput istream) { int id = istream.read_ulong(); switch (id) { - case cxCodeSet.ID: + case CodeSetServiceContext.ID: - cxCodeSet codeset = new cxCodeSet(); + CodeSetServiceContext codeset = new CodeSetServiceContext(); codeset.readContext(istream); return codeset; @@ -117,7 +161,7 @@ public class ServiceContext /** * Read a sequence of contexts from the input stream. */ - public static ServiceContext[] readSequence(cdrInput istream) + public static ServiceContext[] readSequence(AbstractCdrInput istream) { int size = istream.read_long(); ServiceContext[] value = new gnu.CORBA.GIOP.ServiceContext[size]; @@ -128,10 +172,10 @@ public class ServiceContext /** * Write the context values into the stream. - * + * * @param ostream a stream to write the data to. */ - public void write(cdrOutput ostream) + public void write(AbstractCdrOutput ostream) { ostream.write_ulong(context_id); ostream.write_sequence(context_data); @@ -140,7 +184,7 @@ public class ServiceContext /** * Write the sequence of contexts into the input stream. */ - public static void writeSequence(cdrOutput ostream, ServiceContext[] value) + public static void writeSequence(AbstractCdrOutput ostream, ServiceContext[] value) { ostream.write_long(value.length); for (int i = 0; i < value.length; i++) @@ -172,8 +216,7 @@ public class ServiceContext // Replace context. if (!replace) throw new BAD_INV_ORDER("Repetetive setting of the context " - + service_context.context_id, 15, - CompletionStatus.COMPLETED_NO); + + service_context.context_id, 15, CompletionStatus.COMPLETED_NO); else cx[exists] = service_context; } @@ -205,15 +248,13 @@ public class ServiceContext // Replace context. if (!replace) throw new BAD_INV_ORDER("Repetetive setting of the context " - + service_context.context_id, 15, - CompletionStatus.COMPLETED_NO); + + service_context.context_id, 15, CompletionStatus.COMPLETED_NO); else cx[exists] = new ServiceContext(service_context); return cx; } } - /** * Find context with the given name in the context array. */ @@ -227,8 +268,8 @@ public class ServiceContext } /** - * Find context with the given name in the context array, - * converting into org.omg.IOP.ServiceContext. + * Find context with the given name in the context array, converting into + * org.omg.IOP.ServiceContext. */ public static org.omg.IOP.ServiceContext findContext(int ctx_name, ServiceContext[] cx) @@ -240,6 +281,17 @@ public class ServiceContext } /** + * Find context with the given name in the context array without conversions. + */ + public static ServiceContext find(int ctx_name, ServiceContext[] cx) + { + for (int i = 0; i < cx.length; i++) + if (cx[i].context_id == ctx_name) + return cx[i]; + return null; + } + + /** * Return a string representation. */ public String toString() |

