Commit bf7ea5bb authored by Rodrigo Carneiro Henrique's avatar Rodrigo Carneiro Henrique
Browse files

[SCS-333]: Remover os métodos activateComponent e deactivateComponent de ComponentContext.


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/scs/core/java/trunk@119838 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 036a96ed
......@@ -195,53 +195,6 @@ public class ComponentContext {
//TODO: logar que um receptaculo foi removido e todas as suas conexões, perdidas
}
/**
* Activates all of the component's facets.
*
* @return A map indicating the facets that could not be activated. The map
* uses the facet name as an identifier and the catched exception as
* the value.
*/
public Map<String, SCSException> activateComponent() {
Map<String, SCSException> errMsgs = new HashMap<String, SCSException>();
for (Facet facet : facets.values()) {
try {
facet.activate();
}
catch (SCSException e) {
//TODO: logar erro ao ativar faceta como warn
errMsgs.put(facet.getName(), e);
}
}
return errMsgs;
}
/**
* Deactivates all of the component's facets within the POA. The facet_ref
* references (from the FacetDescription metadata) remain non-null after the
* call, to maintain access to the Java object.
*
* The user is responsible for reactivating the facets when deemed
* appropriate.
*
* @return A map indicating the facets that could not be deactivated. The map
* uses the facet name as an identifier and the catched exception as
* the value.
*/
public Map<String, SCSException> deactivateComponent() {
Map<String, SCSException> errMsgs = new HashMap<String, SCSException>();
for (Facet facet : facets.values()) {
try {
facet.deactivate();
}
catch (SCSException e) {
//TODO: logar erro ao desativar faceta como warn
errMsgs.put(facet.getName(), e);
}
}
return errMsgs;
}
/**
* Provides metadata about the component's facets.
*
......
......@@ -120,7 +120,7 @@ public final class Facet {
}
}
void activate() throws SCSException {
private void activate() throws SCSException {
try {
this.reference = this.poa.servant_to_reference(this.servant);
}
......
......@@ -276,18 +276,4 @@ public final class ComponentContextTest {
ComponentContext component = new ComponentContext(orb, poa, componentId);
component.removeReceptacle(receptacleName);
}
@Test
public void activateComponent() throws SCSException {
ComponentContext component = new ComponentContext(orb, poa, componentId);
Map<String, SCSException> errors = component.activateComponent();
Assert.assertEquals(0, errors.size());
}
@Test
public void deactivateComponent() throws SCSException {
ComponentContext component = new ComponentContext(orb, poa, componentId);
Map<String, SCSException> errors = component.deactivateComponent();
Assert.assertEquals(0, errors.size());
}
}
......@@ -106,19 +106,6 @@ public final class FacetTest {
facet.setServant(null);
}
@Test
public void activate() throws SCSException {
Facet facet = new Facet(context.getPOA(), name, interfaceName, servant);
facet.activate();
}
@Test
public void activate2() throws SCSException {
Facet facet = new Facet(context.getPOA(), name, interfaceName, servant);
facet.activate();
facet.activate();
}
@Test
public void deactivate() throws SCSException {
Facet facet = new Facet(context.getPOA(), name, interfaceName, servant);
......
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