1 23 24 package org.objectweb.fractal.jonathan; 25 26 import org.objectweb.fractal.api.control.BindingController; 27 28 import org.objectweb.jonathan.apis.kernel.ContextFactory; 29 import org.objectweb.jonathan.apis.presentation.MarshallerFactory; 30 import org.objectweb.jonathan.apis.protocols.ip.TcpIpConnectionMgr; 31 import org.objectweb.jonathan.apis.resources.ChunkFactory; 32 import org.objectweb.jonathan.apis.resources.Scheduler; 33 34 38 39 public class TcpIpProtocol 40 extends org.objectweb.jonathan.libs.protocols.tcpip.TcpIpProtocol 41 implements BindingController 42 { 43 44 public TcpIpProtocol () { 45 super(null, null, null, null, null); 46 } 47 48 public String [] listFc () { 49 return new String [] { 50 "connection-factory", 51 "marshaller-factory", 52 "chunk-factory", 53 "scheduler", 54 "context-factory" 55 }; 56 } 57 58 public Object lookupFc (final String clientItfName) { 59 if (clientItfName.equals("connection-factory")) { 60 return connection_mgr; 61 } else if (clientItfName.equals("marshaller-factory")) { 62 return marshaller_factory; 63 } else if (clientItfName.equals("chunk-factory")) { 64 return chunk_factory; 65 } else if (clientItfName.equals("scheduler")) { 66 return scheduler; 67 } else if (clientItfName.equals("context-factory")) { 68 return context_factory; 69 } 70 return null; 71 } 72 73 public void bindFc (final String clientItfName, final Object serverItf) { 74 if (clientItfName.equals("connection-factory")) { 75 connection_mgr = (TcpIpConnectionMgr)serverItf; 76 } else if (clientItfName.equals("marshaller-factory")) { 77 marshaller_factory = (MarshallerFactory)serverItf; 78 } else if (clientItfName.equals("chunk-factory")) { 79 chunk_factory = (ChunkFactory)serverItf; 80 } else if (clientItfName.equals("scheduler")) { 81 scheduler = (Scheduler)serverItf; 82 } else if (clientItfName.equals("context-factory")) { 83 context_factory = (ContextFactory)serverItf; 84 } 85 } 86 87 public void unbindFc (final String clientItfName) { 88 if (clientItfName.equals("connection-factory")) { 89 connection_mgr = null; 90 } else if (clientItfName.equals("marshaller-factory")) { 91 marshaller_factory = null; 92 } else if (clientItfName.equals("chunk-factory")) { 93 chunk_factory = null; 94 } else if (clientItfName.equals("scheduler")) { 95 scheduler = null; 96 } else if (clientItfName.equals("context-factory")) { 97 context_factory = null; 98 } 99 } 100 } 101 | Popular Tags |