Author: rareddy
Date: 2009-02-25 12:45:32 -0500 (Wed, 25 Feb 2009)
New Revision: 497
Modified:
trunk/server/src/main/java/com/metamatrix/server/HostControllerGuiceModule.java
trunk/server/src/main/java/com/metamatrix/server/ServiceManagerGuiceModule.java
Log:
TEIID-383
Modified: trunk/server/src/main/java/com/metamatrix/server/HostControllerGuiceModule.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/server/HostControllerGuiceModule.java 2009-02-25
15:28:27 UTC (rev 496)
+++
trunk/server/src/main/java/com/metamatrix/server/HostControllerGuiceModule.java 2009-02-25
17:45:32 UTC (rev 497)
@@ -53,6 +53,21 @@
@Override
protected void configure() {
+ commonComponents();
+
+ bind(LogConfiguration.class).toProvider(LogConfigurationProvider.class).in(Scopes.SINGLETON);
+
+ bind(LogListener.class).toProvider(FileLogListenerProvider.class).in(Scopes.SINGLETON);
+
+ // this needs to be removed.
+ binder().requestStaticInjection(LogManager.class);
+ }
+
+ /**
+ * These resources are common between hostcontroller and svcmgr.
+ */
+ protected void commonComponents() {
+
String systemName = null;
try {
systemName = CurrentConfiguration.getInstance().getClusterName();
@@ -66,7 +81,6 @@
bindConstant().annotatedWith(Names.named(Configuration.CLUSTERNAME)).to(systemName);
bindConstant().annotatedWith(Names.named(Configuration.LOGFILE)).to(StringUtil.replaceAll(host.getFullName(),
".", "_")+"_hc.log"); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
bindConstant().annotatedWith(Names.named(Configuration.LOGDIR)).to(host.getLogDirectory());
-
Names.bindProperties(binder(), CurrentConfiguration.getInstance().getProperties());
@@ -76,14 +90,7 @@
bind(CacheFactory.class).to(JBossCacheFactory.class).in(Scopes.SINGLETON);
bind(ClusteredRegistryState.class).in(Scopes.SINGLETON);
bind(MessageBus.class).to(VMMessageBus.class).in(Scopes.SINGLETON); // VM Message bus
is in common-internal
- bind(HostMonitor.class).in(Scopes.SINGLETON);
-
- bind(LogConfiguration.class).toProvider(LogConfigurationProvider.class).in(Scopes.SINGLETON);
-
- bind(LogListener.class).toProvider(FileLogListenerProvider.class).in(Scopes.SINGLETON);
-
- // this needs to be removed.
- binder().requestStaticInjection(LogManager.class);
+ bind(HostMonitor.class).in(Scopes.SINGLETON);
}
}
Modified: trunk/server/src/main/java/com/metamatrix/server/ServiceManagerGuiceModule.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/server/ServiceManagerGuiceModule.java 2009-02-25
15:28:27 UTC (rev 496)
+++
trunk/server/src/main/java/com/metamatrix/server/ServiceManagerGuiceModule.java 2009-02-25
17:45:32 UTC (rev 497)
@@ -34,7 +34,13 @@
@Override
protected void configure() {
- super.configure();
+
+ super.commonComponents();
+
bind(HostManagement.class).toProvider(HostManagementProvider.class).in(Scopes.SINGLETON);
+
+ // no logging is required for svcmgr, as it writes using the system.out any log
+ // messages will be sent to null logger. One thing we do not want to do is capture
+ // the system streams for svcmgr.
}
}
Show replies by date