public void prepare(Context ctx) throws ParticipantException {
try {
String brand = properties.get("BRAND");
if (brand == null || brand.trim().equals(""))
throw new ParticipantException("En el participante ValidationParticipant debe especificar el par�metro: BRAND");
String jndi = properties.get("jndi");
if (jndi == null || jndi.trim().equals(""))
jndi = "localhost:1099";
Hashtable<String, String> env = new Hashtable<String, String>();
env.put("java.naming.factory.initial", "org.jboss.naming.NamingContextFactory");
env.put("java.naming.provider.url", jndi);
InitialContext context = new InitialContext(env);
IClient remote = (IClient) context.lookup("ClientImp/remote");
IMessage message = ctx.getOriginalMessage();
String login = (String) message.getElement("SignonRq.SignonPswd.CustId.SPName");
String type = (String) message.getElement("SignonRq.SignonPswd.CustPswd.CryptType");
String pwd = (String) message.getElement("SignonRq.SignonPswd.CustPswd.Pswd");
Client clientReg = remote.getClient(brand, login);
Client clientRq = new Client(brand, login, type, pwd);
if (clientReg != null && ValidationManager.validate(clientReg, clientRq))
return;
throw new ValidationException(clientReg, clientRq);
} catch (NamingException e) {
throw new ParticipantException(e.getMessage());
}
}