本文整理汇总了Java中org.omg.PortableServer.ServantLocatorPackage.CookieHolder类的典型用法代码示例。如果您正苦于以下问题:Java CookieHolder类的具体用法?Java CookieHolder怎么用?Java CookieHolder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CookieHolder类属于org.omg.PortableServer.ServantLocatorPackage包,在下文中一共展示了CookieHolder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preinvoke
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; //导入依赖的package包/类
public Servant preinvoke(byte[] oid, POA adapter, String operation,
CookieHolder cookie) throws ForwardRequest
{
String objKey = new String(oid);
Servant servant = (Servant) contexts.get(objKey);
if (servant == null)
{
servant = readInContext(objKey);
}
return servant;
}
示例2: preinvoke
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; //导入依赖的package包/类
public Servant preinvoke(byte[] Object_Id, POA poa, String method,
CookieHolder cookie_holder
)
throws org.omg.PortableServer.ForwardRequest
{
return THIS.preinvoke(Object_Id, poa, method, cookie_holder);
}
示例3: LocalRequest
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; //导入依赖的package包/类
/**
* Create an instance of the local request.
*/
public LocalRequest(gnuServantObject local_object, gnuPOA a_poa, byte[] an_id)
{
Id = an_id;
poa = a_poa;
// Instantiate the cookie holder only if required.
if (poa.servant_locator != null)
{
cookie = new CookieHolder();
}
object = local_object;
prepareStream();
}
示例4: if
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; //导入依赖的package包/类
/**
* Call postinvoke. This method is only used if there was a preinvoke before
* servant invocation.
*
* @param oid
* The object Id.
* @param operation
* The name of the operation invoked.
* @param cookieHolder
* The CookieHolder
* @param servant
* The servant.
* @return The servant.
*/
synchronized protected void
callPostinvoke(byte[] oid,
String operation,
CookieHolder cookieHolder,
org.omg.PortableServer.Servant servant)
{
if ((m_servant_retention_policy.value()
== ServantRetentionPolicyValue.NON_RETAIN)
&& (m_request_processing_policy.value()
== RequestProcessingPolicyValue.USE_SERVANT_MANAGER)) {
if (m_servant_manager == null) {
throw new org.omg.CORBA.OBJ_ADAPTER();
}
org.omg.PortableServer.ServantLocator locator =
(org.omg.PortableServer.ServantLocator) m_servant_manager;
if (isSingleThread()) {
synchronized (locator) {
locator.postinvoke(oid, this, operation,
cookieHolder.value, servant);
}
} else {
locator.postinvoke(oid,
this,
operation,
cookieHolder.value,
servant);
}
}
}
示例5: getCookieHolder
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; //导入依赖的package包/类
CookieHolder getCookieHolder()
{
CookieHolder cookieHolder = peekThrowInternal().getCookieHolder();
throwInternalIfNull(cookieHolder);
return cookieHolder;
}
示例6: getHandler
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; //导入依赖的package包/类
/**
* Return the associated invocation handler.
*/
public InvokeHandler getHandler(String operation, CookieHolder cookie,
boolean forwarding_allowed
) throws gnuForwardRequest
{
if (servant != null && !noRetain)
{
return servantToHandler(servant);
}
else
{
// Use servant locator to locate the servant.
if (poa.servant_locator != null)
{
try
{
servant =
poa.servant_locator.preinvoke(Id, poa, operation, cookie);
return servantToHandler(servant);
}
catch (org.omg.PortableServer.ForwardRequest forw_ex)
{
if (forwarding_allowed)
{
throw new gnuForwardRequest(forw_ex.forward_reference);
}
else
{
servant =
ForwardedServant.create(forw_ex.forward_reference);
return servantToHandler(servant);
}
}
}
else
// Use servant activator to locate the servant.
if (poa.applies(ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) &&
poa.applies(ServantRetentionPolicyValue.RETAIN)
)
{
try
{
poa.activate_object_with_id(Id, servant, forwarding_allowed);
servant = poa.id_to_servant(Id);
return servantToHandler(servant);
}
catch (gnuForwardRequest forwarded)
{
throw forwarded;
}
catch (Exception ex)
{
BAD_OPERATION bad =
new BAD_OPERATION("Unable to activate", Minor.Activation,
CompletionStatus.COMPLETED_NO
);
bad.initCause(ex);
throw bad;
}
}
else if (poa.default_servant != null)
{
servant = poa.default_servant;
return servantToHandler(servant);
}
// No servant and no servant manager - throw exception.
else
{
throw new BAD_OPERATION("Unable to activate", Minor.Activation,
CompletionStatus.COMPLETED_NO
);
}
}
}
示例7: getHandler
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; //导入依赖的package包/类
/**
* Return the associated invocation handler.
*/
public InvokeHandler getHandler(String method, CookieHolder cookie)
{
return object.getHandler(method, cookie, false);
}
示例8: preinvoke
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; //导入依赖的package包/类
/**
* It is your responsibility to take the preinvoke actions, if any,
* and also supply an appropriate servant for the current invocation.
*
* The default method instructs POA that the servant cannot be
* provided by locator. The OBJ_ADAPTER exception will be
* thrown by POA, unless it uses the available default servant for all
* invocations.
*
* @specnote in GNU Classpath, returning null means that the
* locator does not supply the servant.
*
* @see ServantLocatorOperations#preinvoke
*/
public Servant preinvoke(byte[] Object_id, POA poa, String method,
CookieHolder cookie
)
throws ForwardRequest
{
return null;
}