1 15 16 package org.objectweb.jac.core.dist.corba; 17 18 import org.objectweb.jac.core.utils.Lib; 19 import org.objectweb.jac.core.dist.RemoteContainer; 20 21 import java.io.Serializable ; 22 import java.util.Vector ; 23 24 25 49 50 public class CORBARemoteContainerStub 51 extends RemoteContainer implements Serializable { 52 53 54 55 protected CORBARemoteContainerInterf delegate; 56 57 58 63 64 public CORBARemoteContainerStub( CORBARemoteContainerInterf delegate ) { 65 this.delegate = delegate; 66 } 67 68 69 82 83 public int 84 instantiates( 85 String className, Object [] args, Vector classes, 86 String [] fields, Object [] state 87 ) { 88 89 96 97 byte[][] argsBytes = new byte[0][0]; 98 if ( args != null ) { 99 argsBytes = new byte[args.length][]; 100 for ( int i=0 ; i < args.length ; i++ ) 101 argsBytes[i] = Lib.serialize( args[i] ); 102 } 103 104 if ( fields == null ) fields = new String [0]; 105 106 byte[][] stateBytes = new byte[0][0]; 107 if ( state != null ) { 108 stateBytes = new byte[state.length][]; 109 for ( int i=0 ; i < state.length ; i++ ) 110 stateBytes[i] = Lib.serialize( state[i] ); 111 } 112 113 return 114 delegate.instantiates( 115 className, argsBytes, Lib.serialize(classes), 116 fields, stateBytes 117 ); 118 } 119 120 121 128 129 public void copy( int index, String [] fields, Object [] state ) { 130 131 byte[][] stateBytes = new byte[state.length][]; 132 for ( int i=0 ; i < state.length ; i++ ) 133 stateBytes[i] = Lib.serialize( state[i] ); 134 135 delegate.copy( index, fields, stateBytes ); 136 } 137 138 139 150 151 public Object invoke( int index, String methodName, Object [] methodArgs ) { 152 153 byte[][] methodArgsBytes = new byte[methodArgs.length][]; 154 for ( int i=0 ; i < methodArgs.length ; i++ ) 155 methodArgsBytes[i] = Lib.serialize( methodArgs[i] ); 156 157 return 158 Lib.deserialize( delegate.invoke(index,methodName,methodArgsBytes) ); 159 } 160 161 162 173 174 public Vector getClientStubWrappingChain( int index ) { 175 176 return 177 (Vector ) Lib.deserialize(delegate.getClientStubWrappingChain2(index)); 178 } 179 180 } 181 | Popular Tags |