1 28 29 package org.objectweb.security.propagation; 30 31 import org.objectweb.jonathan.apis.kernel.Context; 32 import org.objectweb.jonathan.apis.kernel.InternalException; 33 import org.objectweb.jonathan.apis.kernel.JonathanException; 34 import org.objectweb.jonathan.presentation.api.MarshallerFactory; 35 import org.objectweb.jonathan.libs.kernel.GenericFactory; 36 37 38 41 public class SSHandlerFactory extends GenericFactory { 42 43 46 static public final String jonasss_context_name = "/jonas/security/SSHandler"; 47 48 64 protected Object [] getUsedComponents(Context c) { 65 66 Object [] used_components = { 67 Context.NO_VALUE, Context.NO_VALUE, Context.NO_VALUE, Context.NO_VALUE 68 }; 69 70 if (c != null) { 71 used_components[0] = c.getValue("id", (char) 0); 72 used_components[1] = c.getValue("sender", (char) 0); 73 used_components[2] = c.getValue("receiver", (char) 0); 74 used_components[3] = c.getValue("MarshallerFactory", (char) 0); 75 } 76 if (! (used_components[0] instanceof Integer )) { 77 used_components[0] = new Integer (Integer.MAX_VALUE); 78 } 79 if (! (used_components[1] instanceof SecuritySender)) { 80 used_components[1] = null; 81 } 82 if (! (used_components[2] instanceof SecurityReceiver)) { 83 used_components[2] = null; 84 } 85 if (! (used_components[3] instanceof MarshallerFactory)) { 86 throw new InternalException("Component MarshallerFactory of type MarshallerFactory is required by SSHandler."); 87 } 88 return used_components; 89 } 90 91 100 protected Object newInstance(Context c, Object [] components) throws JonathanException { 101 return new SSHandler(c, components); 102 } 103 } 104 | Popular Tags |