Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Context context = new InitialContext();
- final String appName = "TesteModuloPagamentoCliente-ear-1.0-SNAPSHOT";
- final String moduleName = "TesteModuloPagamentoCliente-ejb-1.0-SNAPSHOT";
- final String distinctName = "";
- final String beanName = "RegraPagamentoCliente1";
- final String viewClassName = IFlexibleRuleRemote.class.getName();
- String ejbName = "ejb:" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName;
- System.out.println("Looking EJB via JNDI ");
- System.out.println(ejbName);
- IFlexibleRuleRemote regraPagamentoRemoto = (IFlexibleRuleRemote) context.lookup(ejbName);
- if (regraPagamentoRemoto.isOnline()) {
- return regraPagamentoRemoto;
- } else {
- return regraPagamentoAplicacao;
- }
- Context context = new InitialContext();
- String jndiName = "ejb:TesteModuloPagamentoCliente-ear-1.0-SNAPSHOT/TesteModuloPagamentoCliente-ejb-1.0-SNAPSHOT//RegraPagamentoCliente1!br.com.silas.tail.pagamentoutil.IFlexibleRuleRemote";
- FlexibleRuleRemoteI i = (FlexibleRuleRemoteI) context.lookup(jndiName);
- System.out.println("sldfkasfd " + i.isOnline());
- return (T) i;
- java.naming.factory.url.pkgs=org.jboss.ejb.client.naming
- endpoint.name=TesteModuloPagamentoCliente-ear-1.0-SNAPSHOT
- remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
- remote.connections=default
- remote.connection.default.host=127.0.0.1
- remote.connection.default.port=6060
- remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
- remote.connection.default.username=remote
- remote.connection.default.password=remote
- @Remote(value = FlexibleRuleRemoteI.class)
- @Stateless
- public class RegraPagamentoCliente1 implements IFlexibleRuleRemote, Serializable {
- private static final long serialVersionUID = 1L;
- @Override
- public void run(Object object) {
- System.out.println("Oi eu sou o servidor " + object.toString());
- }
- @Override
- public boolean isOnline() {
- return true;
- }
- }
- package br.com.silas.tail.pagamentoutil;
- public interface IFlexibleRuleRemote {
- public boolean isOnline();
- public void run(Object object);
- }
Add Comment
Please, Sign In to add comment