本文整理汇总了Java中org.omg.CORBA.PolicyError类的典型用法代码示例。如果您正苦于以下问题:Java PolicyError类的具体用法?Java PolicyError怎么用?Java PolicyError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PolicyError类属于org.omg.CORBA包,在下文中一共展示了PolicyError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: partialRead
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
/**
* Reads the policies as a pair PolicyType/encapsuled policy data
* @param input
*/
public void partialRead(CDRInputStream input)
{
int size = input.read_ulong();
Policy policy = null;
for (int i = 0; i< size; i++) {
policy = PolicyFactory.readPolicy(input);
if(policy != null) {
try {
setPolicy(policy);
}
catch (PolicyError e) {//unreachable
}
}
}
}
示例2: parse_bidirectional
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
/**
* Parse the ORB nominal Bidirectional Policy.
*
* @param str
* the policy value.
* @pre Values must be "NORMAL", "BOTH".
* @exception org.omg.CORBA.INITIALIZE
* if the string does not contains a valid value.
*/
//TODO: remove iiop, this is por ORB's policy manager...
public void parse_bidirectional(String str)
{
if (str == null)
return;
short value = 0;
if (str.equals("NORMAL")) {
return;
} else if (str.equals("BOTH")) {
try {
policy_context.setPolicy(
new BidirectionalPolicyImpl(org.omg.BiDirPolicy.BOTH.value));
}
catch (PolicyError pe) {}
} else {
throw new org.omg.CORBA.INITIALIZE("Invalid value"
+ bidirectional_name
+ "=" + str);
}
}
示例3: parse_max_blocked_time
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
/**
* Parse the max_blocked_time value.
*
* @param str
* the value digits.
* @pre Values must be >= 0.
* @exception org.omg.CORBA.INITIALIZE
* if the string does not contains a valid value.
*/
public void parse_max_blocked_time(String str)
{
if (str == null)
return;
long value = parse_long(max_blocked_time_name, str);
if (value < 0)
throw new INITIALIZE(max_blocked_time_name + ":invalid value "
+ value + " (minimum blocked 0)");
if (value != DEFAULT_MAX_BLOCKED_TIME) {
// converts to TimeT (from ms to units of 100 ns)
value = UTC.toTimeT(value);
try {
policy_context.setPolicy(
new RelativeRoundtripTimeoutPolicyImpl(value));
}
catch (PolicyError pe) {}
max_blocked_time = value;
}
}
示例4: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public static BidirectionalPolicyImpl createPolicy(Any val)
throws org.omg.CORBA.PolicyError
{
try {
short policy_value = BidirectionalPolicyValueHelper.extract(val);
if ((policy_value != org.omg.BiDirPolicy.BOTH.value)
&& (policy_value != org.omg.BiDirPolicy.NORMAL.value))
throw new PolicyError(BAD_POLICY_VALUE.value);
return new BidirectionalPolicyImpl(policy_value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}
示例5: add_server_request_interceptor_with_policy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public void add_server_request_interceptor_with_policy (
ServerRequestInterceptor interceptor, Policy[] policies )
throws DuplicateName, PolicyError
{
// XXX ignore policies for now
add_server_request_interceptor( interceptor ) ;
}
示例6: add_ior_interceptor_with_policy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public void add_ior_interceptor_with_policy (
IORInterceptor interceptor, Policy[] policies )
throws DuplicateName, PolicyError
{
// XXX ignore policies for now
add_ior_interceptor( interceptor ) ;
}
示例7: create_policy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
/**
* Create policy using the previously registered factory.
*/
public Policy create_policy(int type, Any value)
throws PolicyError
{
Integer policy = new Integer(type);
PolicyFactory forge = (PolicyFactory) policyFactories.get(policy);
if (forge == null)
throw new PolicyError("No factory registered for policy " + type,
(short) type);
else
return forge.create_policy(type, value);
}
示例8: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public static ThreadPolicyImpl createPolicy(Any val)
throws org.omg.CORBA.PolicyError
{
try {
ThreadPolicyValue value = ThreadPolicyValueHelper.extract(val);
return new ThreadPolicyImpl(value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}
示例9: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public static RequestProcessingPolicyImpl createPolicy(Any val)
throws org.omg.CORBA.PolicyError
{
try {
RequestProcessingPolicyValue value =
RequestProcessingPolicyValueHelper.extract(val);
return new RequestProcessingPolicyImpl(value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}
示例10: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public static LifespanPolicyImpl createPolicy(Any val)
throws org.omg.CORBA.PolicyError
{
try {
LifespanPolicyValue value = LifespanPolicyValueHelper.extract(val);
return new LifespanPolicyImpl(value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}
示例11: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public static IdAssignmentPolicyImpl createPolicy(Any val)
throws org.omg.CORBA.PolicyError
{
try {
IdAssignmentPolicyValue value =
IdAssignmentPolicyValueHelper.extract(val);
return new IdAssignmentPolicyImpl(value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}
示例12: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public static IdUniquenessPolicyImpl createPolicy(Any val)
throws org.omg.CORBA.PolicyError
{
try {
IdUniquenessPolicyValue value =
IdUniquenessPolicyValueHelper.extract(val);
return new IdUniquenessPolicyImpl(value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}
示例13: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public static ImplicitActivationPolicyImpl createPolicy(Any val)
throws org.omg.CORBA.PolicyError
{
try {
ImplicitActivationPolicyValue value =
ImplicitActivationPolicyValueHelper.extract(val);
return new ImplicitActivationPolicyImpl(value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}
示例14: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
public static ServantRetentionPolicyImpl createPolicy (Any val)
throws org.omg.CORBA.PolicyError
{
try {
ServantRetentionPolicyValue value =
ServantRetentionPolicyValueHelper.extract(val);
return new ServantRetentionPolicyImpl(value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}
示例15: createPolicy
import org.omg.CORBA.PolicyError; //导入依赖的package包/类
/**
* <code>createPolicy</code> create a new CompressionLowValuePolicyImpl.
*
* @param val an <code>Any</code> value
* @return a <code>CompressionLowValuePolicyImpl</code> value
* @exception org.omg.CORBA.PolicyError if an error occurs
*/
public static CompressionLowValuePolicyImpl createPolicy(Any val)
throws org.omg.CORBA.PolicyError
{
try {
int policy_value =
CompressionLowValuePolicyValueHelper.extract(val);
return new CompressionLowValuePolicyImpl(policy_value);
}
catch (BAD_PARAM bp) {
throw new PolicyError(BAD_POLICY_VALUE.value);
}
}