Hi,
I'm just looking for a way to configure the visibility of services
within the IoC container. The target would be
have module internal services i.e. these internal services can be
injected to services within the same module only.
A short example to illustrate, in the MyCoreModule I want to hide the
configuration reader and the category factory:
@SubModule( {
MySubModule.class
})
@Marker(MyCore.class)
public class MyCoreModule
{
public static void bind(ServiceBinder binder)
{
binder.bind(CategoryFactory.class,
CategoryFactoryImpl.class).private();
binder.bind(ConfigurationReader.class,
ConfigurationReaderImpl.class).private();
binder.bind(ConfigurationProvider.class,
ConfigurationProviderImpl.class);
binder.bind(ConfigurationStartup.class,
ConfigurationStartupImpl.class);
binder.bind(SystemControl.class, SystemControlImpl.class);
}
@EagerLoad
public static Startup buildStartup(final List<StartupItem>
startupItems, Logger logger)
{
return new StartupImpl(logger, startupItems);
}
}
Now we have a second Module:
@Marker(MySub.class)
public class MySubModule
{
public static void bind(ServiceBinder binder)
{
// ...
}
public static SomeService buildSomeService(CategoryFactory factory)
{
// shouldn't be work ! a service not found exception would be the
nicest ...
return ...;
}
}
Is this possible? If not is there a plan to implement it?
Thanks,
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]