}
}
private static void configureOptCopier(ORB orb, Class cls,
ObjectCopierFactory stream) {
CopierManager cpm = orb.getCopierManager();
// Get the reference copier factory
ObjectCopierFactory reference = CopyobjectDefaults.
getReferenceObjectCopierFactory();
try {
Method m = cls.getMethod("makeReflectObjectCopierFactory",
new Class[] {com.sun.corba.ee.spi.orb.ORB.class});
ObjectCopierFactory reflect =
(ObjectCopierFactory)m.invoke(cls, new Object[] {orb});
ObjectCopierFactory fallback =
CopyobjectDefaults.makeFallbackObjectCopierFactory(reflect, stream);
cpm.registerObjectCopierFactory(fallback,
POARemoteReferenceFactory.PASS_BY_VALUE_ID);
cpm.registerObjectCopierFactory(reference,
POARemoteReferenceFactory.PASS_BY_REFERENCE_ID);
cpm.setDefaultId(POARemoteReferenceFactory.PASS_BY_VALUE_ID);
} catch (NoSuchMethodException e) {
logger.log(Level.FINE,"Caught NoSuchMethodException - " + e.getMessage());
logger.log(Level.FINE,"Proceeding with pass-by-value copier set to stream copier");
} catch (IllegalAccessException e) {
logger.log(Level.FINE,"Caught IllegalAccessException - " + e.getMessage());