1 31 package org.objectweb.proactive.core.component.body; 32 33 import org.apache.log4j.Logger; 34 35 import org.objectweb.proactive.core.body.BodyImpl; 36 import org.objectweb.proactive.core.body.MetaObjectFactory; 37 import org.objectweb.proactive.core.body.ProActiveMetaObjectFactory; 38 import org.objectweb.proactive.core.component.ComponentParameters; 39 import org.objectweb.proactive.core.component.identity.ProActiveComponent; 40 41 47 import java.util.Hashtable ; 48 49 50 53 public class ComponentBodyImpl extends BodyImpl implements ComponentBody { 54 protected static Logger logger = Logger.getLogger(ComponentBodyImpl.class.getName()); 55 56 private ProActiveComponent componentIdentity = null; 58 59 62 public ComponentBodyImpl() { 63 super(); 64 } 65 66 74 public ComponentBodyImpl(Object reifiedObject, String nodeURL, 75 MetaObjectFactory factory, String jobID) { 76 super(reifiedObject, nodeURL, factory, jobID); 77 78 Hashtable factory_parameters = factory.getParameters(); 81 if ((factory_parameters != null)) { 82 if (factory_parameters.get( 83 ProActiveMetaObjectFactory.COMPONENT_PARAMETERS_KEY) != null) { 84 if (factory_parameters.get( 85 ProActiveMetaObjectFactory.COMPONENT_PARAMETERS_KEY) instanceof ComponentParameters) { 86 if (logger.isDebugEnabled()) { 87 logger.debug("creating metaobject component identity"); 88 } 89 componentIdentity = factory.newComponentFactory() 90 .newProActiveComponent(this); 91 } else { 92 logger.error( 93 "component parameters for the components factory are not of type ComponentParameters"); 94 } 95 } 96 } 97 } 98 99 103 public ProActiveComponent getProActiveComponent() { 104 return componentIdentity; 105 } 106 107 } 108 | Popular Tags |