1 31 package org.objectweb.proactive.ext.locationserver; 32 33 import org.objectweb.proactive.core.body.MetaObjectFactory; 34 import org.objectweb.proactive.core.body.UniversalBody; 35 import org.objectweb.proactive.core.body.migration.MigrationManager; 36 import org.objectweb.proactive.core.body.migration.MigrationManagerFactory; 37 import org.objectweb.proactive.core.body.request.Request; 38 import org.objectweb.proactive.core.body.request.RequestFactory; 39 import org.objectweb.proactive.core.body.rmi.ProActiveRmiMetaObjectFactory; 40 import org.objectweb.proactive.core.mop.MethodCall; 42 43 44 54 public class LocationServerMetaObjectFactory 55 extends ProActiveRmiMetaObjectFactory { 56 private static MetaObjectFactory instance = null; 60 61 65 68 protected LocationServerMetaObjectFactory() { 69 super(); 70 } 71 72 public static synchronized MetaObjectFactory newInstance() { 76 if (instance == null) { 77 instance = new LocationServerMetaObjectFactory(); 78 } 79 return instance; 80 } 81 82 protected RequestFactory newRequestFactorySingleton() { 86 return new RequestWithLocationServerFactory(); 87 } 88 89 protected MigrationManagerFactory newMigrationManagerFactorySingleton() { 90 return new MigrationManagerFactoryImpl(); 91 } 92 93 protected class RequestWithLocationServerFactory implements RequestFactory, 97 java.io.Serializable { 98 transient private LocationServer server = LocationServerFactory.getLocationServer(); 99 100 public Request newRequest(MethodCall methodCall, 101 UniversalBody sourceBody, boolean isOneWay, long sequenceID) { 102 return new RequestWithLocationServer(methodCall, sourceBody, 103 isOneWay, sequenceID, server); 104 } 105 } 106 107 protected static class MigrationManagerFactoryImpl 108 implements MigrationManagerFactory, java.io.Serializable { 109 public MigrationManager newMigrationManager() { 110 return new MigrationManagerWithLocationServer(LocationServerFactory.getLocationServer()); 111 } 112 } 113 } 114 | Popular Tags |