try {
endpoint = new PxeEndpoint(pxeEndpoint);
operation = parseQName(defaultOperation);
if (configuration == null) {
throw new InitialisationException(new org.mule.config.i18n.Message(Messages.X_IS_NULL, "configuration param"), this);
}
if (logger.isDebugEnabled()) {
logConfig();
}
ObjectName modBpelEventLogger = new ObjectName("fivesight.pxe:mod=BpelLogger");
this.server.createMBean(ModBpelEventLogger.class.getName(), modBpelEventLogger);
ObjectName modJdbcDS = new ObjectName("fivesight.pxe:mod=PxeDB");
this.server.createMBean(ModJdbcDS.class.getName(), modJdbcDS);
this.server.setAttribute(modJdbcDS, new Attribute("DataSourceName", dbAttributes.get("DataSourceName")));
this.server.setAttribute(modJdbcDS, new Attribute("TransactionManagerName", dbAttributes.get("TransactionManagerName")));
this.server.setAttribute(modJdbcDS, new Attribute("Driver", dbAttributes.get("Driver")));
this.server.setAttribute(modJdbcDS, new Attribute("Username", dbAttributes.get("Username")));
this.server.setAttribute(modJdbcDS, new Attribute("Password", dbAttributes.get("Password")));
this.server.setAttribute(modJdbcDS, new Attribute("Url", dbAttributes.get("Url")));
this.server.setAttribute(modJdbcDS, new Attribute("PoolMax", new Integer(descriptor.getPoolingProfile().getMaxActive())));
this.server.setAttribute(modJdbcDS, new Attribute("PoolMin", new Integer(descriptor.getPoolingProfile().getMaxIdle())));
ObjectName modDAO = new ObjectName("fivesight.pxe:mod=HibernateDAO");
this.server.createMBean(ModHibernateDAO.class.getName(), modDAO);
this.server.setAttribute(modDAO, new Attribute("BpelStateStoreConnectionFactory", daoAttributes.get("BpelStateStoreConnectionFactory")));
this.server.setAttribute(modDAO, new Attribute("StateStoreConnectionFactory", daoAttributes.get("StateStoreConnectionFactory")));
this.server.setAttribute(modDAO, new Attribute("TransactionManager", daoAttributes.get("TransactionManager")));
this.server.setAttribute(modDAO, new Attribute("DataSource", daoAttributes.get("DataSource")));
URL hibernateProps = ClassUtils.getResource("hibernate.properties", getClass());
String temp = "Not Found";
if (hibernateProps != null) {
temp = hibernateProps.toString();
}
this.server.setAttribute(modDAO, new Attribute("HibernateProperties", temp));
ObjectName modSPBpel = new ObjectName("fivesight.pxe:mod=ServiceProvider,name=Bpel");
this.server.createMBean(ModSvcProvider.class.getName(), modSPBpel);
this.server.setAttribute(modSPBpel, new Attribute("JndiName", bpelAttributes.get("JndiName")));
this.server.setAttribute(modSPBpel, new Attribute("TransactionManagerName", bpelAttributes.get("TransactionManagerName")));
this.server.setAttribute(modSPBpel, new Attribute("ProviderClass", bpelAttributes.get("ProviderClass")));
this.server.setAttribute(modSPBpel, new Attribute("ProviderURI", bpelAttributes.get("ProviderURI")));
this.server.setAttribute(modSPBpel, new Attribute("ProviderProperties", bpelAttributes.get("ProviderProperties")));
ObjectName modSPMule = new ObjectName("fivesight.pxe:mod=ServiceProvider,name=Mule");
this.server.createMBean(ModSvcProvider.class.getName(), modSPMule);
this.server.setAttribute(modSPMule, new Attribute("JndiName", "MuleSP"));
this.server.setAttribute(modSPMule, new Attribute("TransactionManagerName", "PxeTransactionManager"));
this.server.setAttribute(modSPMule, new Attribute("ProviderClass", MuleProtocolAdapter.class.getName()));
this.server.setAttribute(modSPMule, new Attribute("ProviderURI", "uri:protocoladapter.mule"));
ObjectName modSfwk = new ObjectName("fivesight.pxe:mod=PXE");
this.server.createMBean(ModSfwk.class.getName(), modSfwk);
this.server.setAttribute(modSfwk, new Attribute("DomainId", "mule"));
this.server.setAttribute(modSfwk, new Attribute("TransactionManager", "PxeTransactionManager"));
this.server.setAttribute(modSfwk, new Attribute("DAOConnectionFactory", "sscf"));
this.server.setAttribute(modSfwk, new Attribute("SvcProviderJndiBindings", "BpelSP,MuleSP"));
names.add(modBpelEventLogger);
names.add(modJdbcDS);
names.add(modDAO);
names.add(modSPBpel);
names.add(modSPMule);
names.add(modSfwk);
try {
InitialContext ctx = new InitialContext();
TransactionManager txManager = MuleManager.getInstance().getTransactionManager();
if (txManager == null) {
throw new InitialisationException(new org.mule.config.i18n.Message(Messages.TX_MANAGER_NOT_SET), this);
}
ctx.rebind("PxeTransactionManager", txManager);
ctx.close();
} catch (NamingException e) {
throw new InitialisationException(new org.mule.config.i18n.Message(Messages.FAILED_TO_CREATE_X, descriptor.getName()), e, this);
}
} catch (Exception e) {
throw new InitialisationException(new org.mule.config.i18n.Message(Messages.FAILED_TO_CREATE_X, descriptor.getName()), e, this);
}
}