1 7 8 package com.sun.corba.se.spi.extension ; 9 10 import org.omg.CORBA.Policy ; 11 import org.omg.CORBA.LocalObject ; 12 13 import com.sun.corba.se.spi.logging.CORBALogDomains ; 14 15 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; 16 import com.sun.corba.se.impl.orbutil.ORBConstants ; 17 18 21 public class RequestPartitioningPolicy extends LocalObject implements Policy 22 { 23 private static ORBUtilSystemException wrapper = 24 ORBUtilSystemException.get( CORBALogDomains.OA_IOR ) ; 25 public final static int DEFAULT_VALUE = 0; 26 private final int value; 27 28 public RequestPartitioningPolicy( int value ) 29 { 30 if (value < ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID || 31 value > ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID) { 32 throw wrapper.invalidRequestPartitioningPolicyValue( 33 new Integer (value), 34 new Integer ( 35 ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID), 36 new Integer ( 37 ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID)); 38 } 39 this.value = value; 40 } 41 42 public int getValue() 43 { 44 return value; 45 } 46 47 public int policy_type() 48 { 49 return ORBConstants.REQUEST_PARTITIONING_POLICY; 50 } 51 52 public org.omg.CORBA.Policy copy() 53 { 54 return this; 55 } 56 57 public void destroy() 58 { 59 } 61 62 public String toString() 63 { 64 return "RequestPartitioningPolicy[" + value + "]" ; 65 } 66 } 67 | Popular Tags |