Commit 4cd275ce authored by Carlos Eduardo Lara Augusto's avatar Carlos Eduardo Lara Augusto
Browse files

[SCS-209, SCS-218]

Novo javadoc para o pacote auxiliar, em inglês.



git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/scs/core/java/trunk@115733 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 52d4308e
......@@ -7,33 +7,46 @@ import scs.core.ComponentContext;
import scs.core.ComponentId;
/**
* Servant da interface IDL {@link ComponentHelp}
*
* @author Carlos Eduardo / (comentrios) Amadeu A. Barbosa Jr
* This class is an implementation of the {@link ComponentHelp} CORBA interface.
* The mentioned interface provides help strings for a collection of components.
*
*/
public class ComponentHelpServant extends ComponentHelpPOA {
/**
* Reference to the component instance that this implementation belongs to.
*/
private ComponentContext myComponent;
/**
* Map that associates help strings with component id's.
*/
private Map<String, String> help;
/**
* Primary constructor. Initializes a map that associates help strings with
* component id's.
*
* @param myComponent Reference to the component instance that this
* implementation belongs to.
*/
public ComponentHelpServant(ComponentContext myComponent) {
this.myComponent = myComponent;
this.help = new HashMap<String, String>();
}
/**
* Mtodo para obter a string auxiliar de um componente
* Provides help info for a specific component.
*
* @param id Identificador do componente
* @return String de auxlio
* @param id The component's id.
* @return Help string.
*/
public String getHelpInfo(ComponentId id) throws HelpInfoNotAvailable {
return help.get(id.name);
}
/**
* Retorna a referncia para a faceta IComponent. Especfico do JACORB.
* Provides a reference for the IComponent facet of this component.
*/
@Override
public org.omg.CORBA.Object _get_component() {
......
......@@ -6,25 +6,48 @@ import java.util.Map;
import scs.core.ComponentContext;
/**
* Servant da inteface IDL {@link ComponentProperties}
*
* @author Carlos Eduardo / (comentrios) Amadeu A. Barbosa Jnior
* This class is an implementation of the {@link ComponentProperties} CORBA
* interface. The mentioned interface provides access to exported properties of
* a component.
*
*/
public class ComponentPropertiesServant extends ComponentPropertiesPOA {
/**
* Reference to the component instance that this implementation belongs to.
*/
private ComponentContext myComponent;
/**
* Map that associates property names with instances of the Property structure
* defined in IDL.
*/
private Map<String, Property> props;
/**
* Primary constructor. Initializes a map that associates property names with
* instances of the Property structure defined in IDL.
*
* @param myComponent Reference to the component instance that this
* implementation belongs to.
*/
public ComponentPropertiesServant(ComponentContext myComponent) {
this.myComponent = myComponent;
this.props = new HashMap<String, Property>();
}
/**
* Provides an array with all the component's properties.
*/
public Property[] getProperties() {
return props.values().toArray(new Property[props.size()]);
}
/**
* Given a property name, returns its value.
*
* @throws UndefinedProperty If the property name does not exist.
*/
public Property getProperty(String name) throws UndefinedProperty {
Property value = props.get(name);
if (value != null)
......@@ -32,6 +55,12 @@ public class ComponentPropertiesServant extends ComponentPropertiesPOA {
throw new UndefinedProperty();
}
/**
* Given a property name, sets a new value. If the property doesn't exist,
* does nothing.
*
* @throws ReadOnlyProperty If the property cannot be changed.
*/
public void setProperty(Property prop) throws ReadOnlyProperty {
Property value = props.get(prop.name);
if (value != null)
......@@ -42,7 +71,7 @@ public class ComponentPropertiesServant extends ComponentPropertiesPOA {
}
/**
* Retorna a referncia para a faceta IComponent. Especfico do JACORB.
* Provides a reference for the IComponent facet of this component.
*/
@Override
public org.omg.CORBA.Object _get_component() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment