00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 package org.objectweb.security.propagation;
00030
00031 import org.objectweb.jonathan.apis.kernel.Context;
00032 import org.objectweb.jonathan.apis.kernel.InternalException;
00033 import org.objectweb.jonathan.apis.kernel.JonathanException;
00034 import org.objectweb.jonathan.presentation.api.MarshallerFactory;
00035 import org.objectweb.jonathan.libs.kernel.GenericFactory;
00036
00037
00041 public class SSHandlerFactory extends GenericFactory {
00042
00046 static public final String jonasss_context_name = "/jonas/security/SSHandler";
00047
00064 protected Object[] getUsedComponents(Context c) {
00065
00066 Object[] used_components = {
00067 Context.NO_VALUE, Context.NO_VALUE, Context.NO_VALUE, Context.NO_VALUE
00068 };
00069
00070 if (c != null) {
00071 used_components[0] = c.getValue("id", (char) 0);
00072 used_components[1] = c.getValue("sender", (char) 0);
00073 used_components[2] = c.getValue("receiver", (char) 0);
00074 used_components[3] = c.getValue("MarshallerFactory", (char) 0);
00075 }
00076 if (! (used_components[0] instanceof Integer)) {
00077 used_components[0] = new Integer(Integer.MAX_VALUE);
00078 }
00079 if (! (used_components[1] instanceof SecuritySender)) {
00080 used_components[1] = null;
00081 }
00082 if (! (used_components[2] instanceof SecurityReceiver)) {
00083 used_components[2] = null;
00084 }
00085 if (! (used_components[3] instanceof MarshallerFactory)) {
00086 throw new InternalException("Component MarshallerFactory of type MarshallerFactory is required by SSHandler.");
00087 }
00088 return used_components;
00089 }
00090
00100 protected Object newInstance(Context c, Object[] components) throws JonathanException {
00101 return new SSHandler(c, components);
00102 }
00103 }