本文整理汇总了Java中com.sun.corba.se.spi.servicecontext.ServiceContext类的典型用法代码示例。如果您正苦于以下问题:Java ServiceContext类的具体用法?Java ServiceContext怎么用?Java ServiceContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceContext类属于com.sun.corba.se.spi.servicecontext包,在下文中一共展示了ServiceContext类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: writeMapEntry
import com.sun.corba.se.spi.servicecontext.ServiceContext; //导入依赖的package包/类
/**
* Write the given entry from the scMap to the OutputStream.
* See note on giopVersion. The service context should
* know the GIOP version it is meant for.
*/
private void writeMapEntry(OutputStream os, Integer id, Object scObj, GIOPVersion gv) {
// If it's still in byte[] form, we don't need to
// unmarshal it here, just copy the bytes into
// the new stream.
if (scObj instanceof byte[]) {
if (isDebugging(os))
dprint( "Writing service context bytes for id " + id);
OctetSeqHelper.write(os, (byte[])scObj);
} else {
// We actually unmarshaled it into a ServiceContext
// at some point.
ServiceContext sc = (ServiceContext)scObj;
if (isDebugging(os))
dprint( "Writing service context " + sc ) ;
sc.write(os, gv);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:ServiceContexts.java
示例2: get
import com.sun.corba.se.spi.servicecontext.ServiceContext; //导入依赖的package包/类
public ServiceContext get(Integer id)
{
Object result = scMap.get(id);
if (result == null)
return null ;
// Lazy unmarshaling on first use.
if (result instanceof byte[]) {
ServiceContext sc = unmarshal(id, (byte[])result);
scMap.put(id, sc);
return sc;
} else {
return (ServiceContext)result;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:ServiceContexts.java
示例3: getExceptionDetailMessage
import com.sun.corba.se.spi.servicecontext.ServiceContext; //导入依赖的package包/类
protected void getExceptionDetailMessage(
CorbaMessageMediator messageMediator,
ORBUtilSystemException wrapper)
{
ServiceContext sc = messageMediator.getReplyServiceContexts()
.get(ExceptionDetailMessage.value);
if (sc == null)
return ;
if (! (sc instanceof UnknownServiceContext)) {
throw wrapper.badExceptionDetailMessageServiceContextType();
}
byte[] data = ((UnknownServiceContext)sc).getData();
EncapsInputStream in =
EncapsInputStreamFactory.newEncapsInputStream((ORB)messageMediator.getBroker(),
data, data.length);
in.consumeEndian();
String msg =
"----------BEGIN server-side stack trace----------\n"
+ in.read_wstring() + "\n"
+ "----------END server-side stack trace----------";
messageMediator.setReplyExceptionDetailMessage(msg);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:CorbaClientRequestDispatcherImpl.java
示例4: getExceptionDetailMessage
import com.sun.corba.se.spi.servicecontext.ServiceContext; //导入依赖的package包/类
protected void getExceptionDetailMessage(
CorbaMessageMediator messageMediator,
ORBUtilSystemException wrapper)
{
ServiceContext sc = messageMediator.getReplyServiceContexts()
.get(ExceptionDetailMessage.value);
if (sc == null)
return ;
if (! (sc instanceof UnknownServiceContext)) {
throw wrapper.badExceptionDetailMessageServiceContextType();
}
byte[] data = ((UnknownServiceContext)sc).getData();
EncapsInputStream in =
new EncapsInputStream((ORB)messageMediator.getBroker(),
data, data.length);
in.consumeEndian();
String msg =
"----------BEGIN server-side stack trace----------\n"
+ in.read_wstring() + "\n"
+ "----------END server-side stack trace----------";
messageMediator.setReplyExceptionDetailMessage(msg);
}
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:26,代码来源:CorbaClientRequestDispatcherImpl.java
示例5: put
import com.sun.corba.se.spi.servicecontext.ServiceContext; //导入依赖的package包/类
/** Add a service context to the stream, if there is not already
* a service context in this object with the same id as sc.
*/
public void put( ServiceContext sc )
{
Integer id = new Integer(sc.getId());
scMap.put(id, sc);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ServiceContexts.java
示例6: consumeServiceContexts
import com.sun.corba.se.spi.servicecontext.ServiceContext; //导入依赖的package包/类
protected void consumeServiceContexts(ORB orb,
CorbaMessageMediator messageMediator)
{
ServiceContexts ctxts = messageMediator.getReplyServiceContexts();
ServiceContext sc ;
ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
CORBALogDomains.RPC_PROTOCOL ) ;
if (ctxts == null) {
return; // no service context available, return gracefully.
}
sc = ctxts.get( SendingContextServiceContext.SERVICE_CONTEXT_ID ) ;
if (sc != null) {
SendingContextServiceContext scsc =
(SendingContextServiceContext)sc ;
IOR ior = scsc.getIOR() ;
try {
// set the codebase returned by the server
if (messageMediator.getConnection() != null) {
((CorbaConnection)messageMediator.getConnection()).setCodeBaseIOR(ior);
}
} catch (ThreadDeath td) {
throw td ;
} catch (Throwable t) {
throw wrapper.badStringifiedIor( t ) ;
}
}
// see if the version subcontract is present, if yes, then set
// the ORBversion
sc = ctxts.get( ORBVersionServiceContext.SERVICE_CONTEXT_ID ) ;
if (sc != null) {
ORBVersionServiceContext ovsc =
(ORBVersionServiceContext) sc;
ORBVersion version = ovsc.getVersion();
orb.setORBVersion( version ) ;
}
getExceptionDetailMessage(messageMediator, wrapper);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:CorbaClientRequestDispatcherImpl.java
注:本文中的com.sun.corba.se.spi.servicecontext.ServiceContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论