Hello all.
I want to share my idea and catch your points of view.
My application is big, but it's not ejb-web-based application. It's a
Swing client (Guice-driven) which use a server to synchonize own
state with other parts of system. For my application, server is a very
small communication and registration center with minimal count of
functionality. But I need RMI and JMS. And I am using JBoss as a
server.
But JBoss is big, difficult and EJB 3.0 oriented. It's a great
appserver, but as to me, it's not what I want to use for my
application.
I want to have something small, fast and simple. Guice is small, fast
and simple. But I need RMI and JMS.
Is it possible to add RMI and JMS to Guice and use it like small
remote container?
My idea:
Server side:
1) Create server application modules with bindings.
2) Create Injector from application modules plus RemoteServerModule.
3) After injector creation, RemoteServerModule create little server,
this server is listening a port.
===========================
Module appModule = new AbstractModule() {
protected void configure() {
bind(Registrator.class).to(RegistratorImpl.class);
}
};
Module remoteServerModule = new RemoteServerModule();
Guice.createInjector(appModule, remoteServerModule);
===========================
Client side:
1) Create application modules with bindings.
2) Create Injector from application modules plus RemoteClientModule.
3) RemoteClientModule on configure() call, request bindings of server
Guice contaner and bind them into client Guice container (binding Key -
> RemoteProxyProvider).
4) If Key from server Guice container is injected, RemoteProxyProvider
create new Proxy class (cglib!) which provide communication with
server. On server side we have a real instance which is linked to
client proxy.
============================
Module myModule = new AbstractModule() {
protected void configure() {
bind(UserManager.class).to(UserManagerImpl.class);
}
};
RemoteClientModule remoteClientModule = new RemotetClientModule
("host");
Injector inj = Guice.createInjector(myModule,
remoteClientModule);
UserManager userManager = inj.getInstance(UserManager.class);
public class UserManagerImpl implements UserManager {
//from server
private final Registrator registrator;
@Inject
public UserManagerImpl(Registrator registrator) {
this.registrator = registrator;
}
...
}
==============================
Ok, what we have:
1) Just add one server module to create server!
2) Just any number of client modules to connect to any numbers of
servers.
3) For client application you could inject server component to own
components, almost no difference.
4) Server application is Guice driven and simple.
I have write first version of my idea, a little proof of concept, but
before making further development, I want to ask Guice community, is
it necessary? Or may be I discover the continents again?
What do you think about this idea?
Best regards,
Aleksey.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---