/* 58 */ String proxyFamilyName = objectId.toString() + locator.getProtocol() + partitionName;
/* 59 */ HAPartition partition = (HAPartition)new InitialContext().lookup("/HAPartition/" + partitionName);
/* */
/* 61 */ HATarget target = null;
/* 62 */ Map families = null;
/* 63 */ InstanceAdvisor advisor = null;
/* */ Class clazz;
/* 66 */ if ((obj instanceof Advised))
/* */ {
/* 68 */ advisor = ((Advised)obj)._getInstanceAdvisor();
/* 69 */ Class clazz = obj.getClass();
/* 70 */ Dispatcher.singleton.registerTarget(objectId, obj);
/* */ }
/* */ else
/* */ {
/* 74 */ clazz = obj.getClass();
/* 75 */ ClassProxy proxy = ClassProxyFactory.newInstance(obj.getClass());
/* 76 */ advisor = proxy._getInstanceAdvisor();
/* 77 */ advisor.insertInterceptor(new ForwardingInterceptor(obj));
/* 78 */ Dispatcher.singleton.registerTarget(objectId, proxy);
/* */ }
/* 80 */ families = (Map)advisor.getMetaData().getMetaData("CLUSTERED_REMOTING", "CLUSTER_FAMILIES");
/* 81 */ if (families != null)
/* */ {
/* 83 */ target = (HATarget)families.get(proxyFamilyName);
/* 84 */ if (target == null)
/* */ {
/* 86 */ target = new HATarget(partition, proxyFamilyName, locator, 2);
/* 87 */ ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicants());
/* 88 */ families.put(proxyFamilyName, target);
/* */ }
/* */ }
/* */ else
/* */ {
/* 93 */ families = new HashMap();
/* 94 */ target = new HATarget(partition, proxyFamilyName, locator, 2);
/* 95 */ ClusteringTargetsRepository.initTarget(proxyFamilyName, target.getReplicants());
/* 96 */ families.put(proxyFamilyName, target);
/* 97 */ advisor.insertInterceptor(0, new ReplicantsManagerInterceptor(families));
/* */ }
/* */
/* 100 */ ClassProxy proxy = ClassProxyFactory.newInstance(clazz);
/* 101 */ InstanceAdvisor proxyAdvisor = proxy._getInstanceAdvisor();
/* 102 */ proxyAdvisor.insertInterceptor(IsLocalInterceptor.singleton);
/* 103 */ advisor.insertInterceptor(SecurityClientInterceptor.singleton);
/* 104 */ advisor.insertInterceptor(ClientTxPropagationInterceptor.singleton);
/* 105 */ proxyAdvisor.insertInterceptor(MergeMetaDataInterceptor.singleton);
/* 106 */ proxyAdvisor.insertInterceptor(ClusterChooserInterceptor.singleton);
/* 107 */ proxyAdvisor.insertInterceptor(InvokeRemoteInterceptor.singleton);
/* */
/* 109 */ proxyAdvisor.getMetaData().addMetaData("CLUSTERED_REMOTING", "CLUSTER_FAMILY_WRAPPER", new FamilyWrapper(proxyFamilyName, target.getReplicants()), PayloadKey.AS_IS);
/* */
/* 115 */ proxyAdvisor.getMetaData().addMetaData("CLUSTERED_REMOTING", "LOADBALANCE_POLICY", lb, PayloadKey.AS_IS);
/* */
/* 120 */ proxyAdvisor.getMetaData().addMetaData("REMOTING", "SUBSYSTEM", "AOP", PayloadKey.AS_IS);
/* */
/* 125 */ proxyAdvisor.getMetaData().addMetaData("DISPATCHER", "OID", objectId, PayloadKey.AS_IS);
/* */
/* 130 */ return proxy;
/* */ }