1 22 package org.jboss.iiop.csiv2; 23 24 import org.omg.CORBA.Any ; 25 import org.omg.CORBA.LocalObject ; 26 import org.omg.CORBA.Policy ; 27 import org.omg.CORBA.PolicyError ; 28 import org.omg.IOP.Codec ; 29 import org.omg.PortableInterceptor.PolicyFactory ; 30 31 import org.jboss.metadata.IorSecurityConfigMetaData; 32 33 40 class CSIv2PolicyFactory 41 extends LocalObject 42 implements PolicyFactory 43 { 44 private Codec codec; 45 46 public CSIv2PolicyFactory(Codec codec) 48 { 49 this.codec = codec; 51 } 52 53 55 public Policy create_policy(int type, Any value) 56 throws PolicyError 57 { 58 if (type != CSIv2Policy.TYPE) { 59 throw new PolicyError (); 60 } 61 62 IorSecurityConfigMetaData metadata = 64 (IorSecurityConfigMetaData)value.extract_Value(); 65 66 return new CSIv2Policy(metadata, codec); 67 } 68 } 69 | Popular Tags |