public void start() {
dqpCore.setTransactionService((TransactionService)LogManager.createLoggingProxy(LogConstants.CTX_TXN_LOG, transactionServerImpl, new Class[] {TransactionService.class}, MessageLevel.DETAIL));
if (this.eventDistributorName != null) {
try {
InitialContext ic = new InitialContext();
this.eventDistributor = (EventDistributor) ic.lookup(this.eventDistributorName);
} catch (NamingException ne) {
//log at a detail level since we may not be in the all profile
LogManager.logDetail(LogConstants.CTX_RUNTIME, ne, IntegrationPlugin.Util.getString("jndi_failed", new Date(System.currentTimeMillis()).toString())); //$NON-NLS-1$
}
}
this.dqpCore.start(this);
this.dqpCore.getDataTierManager().setEventDistributor(this.eventDistributor);
// create the necessary services
createClientServices();
int offset = 0;
String portBinding = System.getProperty("jboss.service.binding.set"); //$NON-NLS-1$
if (portBinding != null && portBinding.startsWith("ports-")) { //$NON-NLS-1$
if (portBinding.equals("ports-default")) { //$NON-NLS-1$
offset = 0;
}
else {
try {
offset = Integer.parseInt(portBinding.substring(portBinding.length()-2))*100;
} catch (NumberFormatException e) {
offset = 0;
}
}
}
this.csr.registerClientService(ILogon.class, logon, LogConstants.CTX_SECURITY);
DQP dqpProxy = proxyService(DQP.class, this.dqpCore, LogConstants.CTX_DQP);
this.csr.registerClientService(DQP.class, dqpProxy, LogConstants.CTX_DQP);
Admin adminProxy = proxyService(Admin.class, admin, LogConstants.CTX_ADMIN_API);
this.csr.registerClientService(Admin.class, adminProxy, LogConstants.CTX_ADMIN_API);
ClientServiceRegistryImpl jdbcCsr = new ClientServiceRegistryImpl();
jdbcCsr.registerClientService(ILogon.class, logon, LogConstants.CTX_SECURITY);
jdbcCsr.registerClientService(DQP.class, dqpProxy, LogConstants.CTX_DQP);
if (this.jdbcSocketConfiguration.getEnabled()) {
this.jdbcSocket = new SocketListener(this.jdbcSocketConfiguration, jdbcCsr, this.dqpCore.getBufferManager(), offset);
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("socket_enabled","Teiid JDBC = ",(this.jdbcSocketConfiguration.getSSLConfiguration().isSslEnabled()?"mms://":"mm://")+this.jdbcSocketConfiguration.getHostAddress().getHostName()+":"+(this.jdbcSocketConfiguration.getPortNumber()+offset))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
} else {
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("socket_not_enabled", "jdbc connections")); //$NON-NLS-1$ //$NON-NLS-2$
}
ClientServiceRegistryImpl adminCsr = new ClientServiceRegistryImpl(Type.Admin);
adminCsr.registerClientService(ILogon.class, logon, LogConstants.CTX_SECURITY);
adminCsr.registerClientService(Admin.class, adminProxy, LogConstants.CTX_ADMIN_API);
if (this.adminSocketConfiguration.getEnabled()) {
this.adminSocket = new SocketListener(this.adminSocketConfiguration, adminCsr, this.dqpCore.getBufferManager(), offset);
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("socket_enabled","Teiid Admin", (this.adminSocketConfiguration.getSSLConfiguration().isSslEnabled()?"mms://":"mm://")+this.adminSocketConfiguration.getHostAddress().getHostName()+":"+(this.adminSocketConfiguration.getPortNumber()+offset))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
} else {
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("socket_not_enabled", "admin connections")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (this.odbcSocketConfiguration.getEnabled()) {
this.vdbRepository.odbcEnabled();
this.odbcSocket = new ODBCSocketListener(this.odbcSocketConfiguration, this.dqpCore.getBufferManager(), offset, getMaxODBCLobSizeAllowed());
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("odbc_enabled","Teiid ODBC - SSL=", (this.odbcSocketConfiguration.getSSLConfiguration().isSslEnabled()?"ON":"OFF")+" Host = "+this.odbcSocketConfiguration.getHostAddress().getHostName()+" Port = "+(this.odbcSocketConfiguration.getPortNumber()+offset))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
} else {
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("odbc_not_enabled")); //$NON-NLS-1$
}
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.getString("engine_started", getRuntimeVersion(), new Date(System.currentTimeMillis()).toString())); //$NON-NLS-1$
if (jndiName != null) {
final InitialContext ic ;
try {
ic = new InitialContext() ;
Util.bind(ic, jndiName, this) ;
} catch (final NamingException ne) {
// Add jndi_failed to bundle
LogManager.logError(LogConstants.CTX_RUNTIME, ne, IntegrationPlugin.Util.getString("jndi_failed", new Date(System.currentTimeMillis()).toString())); //$NON-NLS-1$
}