onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1503210 - /onami/sandbox/console/src/main/java/org/apache/onami/console/modules/descriptor/IoDescriptorsModule.java
Date Mon, 15 Jul 2013 12:49:52 GMT
Author: simonetripodi
Date: Mon Jul 15 12:49:52 2013
New Revision: 1503210

URL: http://svn.apache.org/r1503210
Log:
avoid to instantiate components by default

Modified:
    onami/sandbox/console/src/main/java/org/apache/onami/console/modules/descriptor/IoDescriptorsModule.java

Modified: onami/sandbox/console/src/main/java/org/apache/onami/console/modules/descriptor/IoDescriptorsModule.java
URL: http://svn.apache.org/viewvc/onami/sandbox/console/src/main/java/org/apache/onami/console/modules/descriptor/IoDescriptorsModule.java?rev=1503210&r1=1503209&r2=1503210&view=diff
==============================================================================
--- onami/sandbox/console/src/main/java/org/apache/onami/console/modules/descriptor/IoDescriptorsModule.java
(original)
+++ onami/sandbox/console/src/main/java/org/apache/onami/console/modules/descriptor/IoDescriptorsModule.java
Mon Jul 15 12:49:52 2013
@@ -19,6 +19,8 @@ package org.apache.onami.console.modules
  * under the License.
  */
 
+import static com.google.inject.Scopes.SINGLETON;
+
 import org.apache.onami.console.descriptor.io.jackson.OnamiConsoleJacksonReader;
 import org.apache.onami.console.descriptor.io.snakeyaml.OnamiConsoleSnakeYamlReader;
 import org.apache.onami.console.descriptor.io.xpp3.OnamiConsoleXpp3Reader;
@@ -33,9 +35,9 @@ public final class IoDescriptorsModule
     protected void configure()
     {
         // textual configurations unmarshallers
-        bind( OnamiConsoleJacksonReader.class ).toInstance( new OnamiConsoleJacksonReader()
);
-        bind( OnamiConsoleSnakeYamlReader.class ).toInstance( new OnamiConsoleSnakeYamlReader()
);
-        bind( OnamiConsoleXpp3Reader.class ).toInstance( new OnamiConsoleXpp3Reader() );
+        bind( OnamiConsoleJacksonReader.class ).to( OnamiConsoleJacksonReader.class ).in(
SINGLETON );
+        bind( OnamiConsoleSnakeYamlReader.class ).to( OnamiConsoleSnakeYamlReader.class ).in(
SINGLETON );
+        bind( OnamiConsoleXpp3Reader.class ).to( OnamiConsoleXpp3Reader.class ).in( SINGLETON
);
     }
 
 }



Mime
View raw message