[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - New package structure

timfox do-not-reply at jboss.com
Tue Feb 26 12:30:00 EST 2008


I have just committed a refactoring to our new package structure.

Here is how it goes:

org.jboss.messaging.core and sub packages.

Contain the messaging core - this is all the stuff needed to make a fully functioning transactional, reliable messaging system.

It does not include jms, nor does it have any dependencies on JEE, JNDI etc. It basically will just depend on J2SE and MINA (if not using an invm transport).

Please be extra careful not to introduce any such dependencies in this layer.

Inside core, it is further split into modules:

core/module-name (e.g. core/management)

this contains the *interfaces* exported by that module. It should only contain interfaces and possible very simple struct like classes.

The implementation of the interfaces goes in:

core/module-name/impl

The idea is that one interface can depend on interfaces from another module, but it *must not* depend on implementations from another module.

This is currently broken in some modules (e.g. deployment, security etc) and this will need fixing, where code depends directly on concrete classes rather than interfaces. (More on this later).

The current modules are:

channelfactory - channel factory stuff (TBD)

cluster

config - the Configuration interface and implementations (Basic, File)

deployers

filter - core filters

list - priority list

logging

management - the core management interface and implemementation

memory- the memory manager (TBD)

messagecounters

persistence - persistence manager implementations

this contains subdirectories:

e.g.

nullpm - the null persistence manager

bdbje - the BDB JE persistence manager

and then we have 

remoting - our remoting layer

security - core security store interface and implementation

server - the core server interfaces and implementation

e.g. messaging server, server connection, server session, queue etc etc

settings - the hierarchical repository stuff that handles queue and security settings

version

client - this contains the core client interfaces and implementation

Then we have the jms stuff.

This is in:

org.jboss.messaging.jms.client - 

This is the client side JMS code

org.jboss.messaging.jms.server - 

This is the server side JMSServerManager and related stuff.

Then we have microcontainer stuff which is specific to the bootstrapping of the MC - much of this can probably be removed now.

In more detail, some modules are currently exposing implementations to other modules, they are:

1) Config - we need to create a Configuration interface which lives in the config module - currently there is a concrete class in the server module and another concrete class RemotingConfiguration in the remoting module. These should be combined and put in the config module.

2) Deployers. Currently abstract class Deployer is exported from the module. This should be an interface. Also DeploymentManager should be an interface. We should also avoid singletons throughput JBM, this is to allow multiple JBM instances to co-exist in the same VM without interacting.

3) messagecounter - currently these are concrete classes - shoud be abstracted out to interface + implementation

4) remoting - there are various concrete classes in this module which are exported to other modules - should be made interfaces

5) security

6) settings - implemtation is used directly

Other things to note:

1) much of the stuff in the microcontainer module doesn't seem necessary any more.. can we remove?

2) If a class is serializable it should be given a serialVersionUID

3) please observe the order of static, public, private etc methods in a class. I've seen quite a few occasions of say, a provate method inserted into the middle of a load of public methods etc.

4) Please avoid K & R style of braces:

e.g.

if (foo) {
//do something
} else if (bar) {
//do somehting else
}

Is not the style we use.

That's about it for now :)

If any of the above comments apply to your areas, can you add to your TODO list to correct.

Cheers.

It's really starting to take shape now :)






View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132265#4132265

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132265



More information about the jboss-dev-forums mailing list