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

Criação do método reset que recoloca o registro em seu estado inicial.


git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/trunk@84612 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 8301900f
......@@ -70,7 +70,7 @@ public final class Registry {
* Cria o registro.
*/
private Registry() {
this.threadLocalCredential = new ThreadLocal<Credential>();
this.reset();
}
/**
......@@ -172,14 +172,15 @@ public final class Registry {
*/
public Credential getRequestCredential() {
try {
Current pic = CurrentHelper.narrow(this.orbWrapper.getORB()
.resolve_initial_references("PICurrent"));
Current pic =
CurrentHelper.narrow(this.orbWrapper.getORB()
.resolve_initial_references("PICurrent"));
Any requestCredentialValue = pic.get_slot(this.requestCredentialSlot);
if (requestCredentialValue.type().kind().equals(TCKind.tk_null)) {
return InvalidTypes.CREDENTIAL;
}
Credential requestCredential = CredentialHelper
.extract(requestCredentialValue);
Credential requestCredential =
CredentialHelper.extract(requestCredentialValue);
return requestCredential;
}
catch (org.omg.CORBA.UserException e) {
......@@ -205,4 +206,18 @@ public final class Registry {
public ISession getSession() {
return this.session;
}
/**
* Retorna para o seu estado inicial, ou seja, desfaz as definies de
* atributos realizadas.
*/
public void reset() {
this.threadLocalCredential = new ThreadLocal<Credential>();
this.requestCredentialSlot = -1;
this.orbWrapper = null;
this.poa = null;
this.acs = null;
this.credential = null;
this.session = null;
}
}
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