[Design the new POJO MicroContainer] - Re: jboss-classload*.xsd appears to be broken
by david.lloyd@jboss.com
"david.lloyd(a)jboss.com" wrote :
| Also IDEA seems fairly certain that you can't use the "base" attribute here, though I'm not sharp enough on my xsd to say for sure:
|
| | <xsd:simpleType name="version" base="xsd:string">
| |
|
It's all coming back to me. Perhaps this should be:
| <xsd:simpleType name="version">
| <xsd:annotation>
| <xsd:documentation>
| <![CDATA[
| A version.
| ]]>
| </xsd:documentation>
| </xsd:annotation>
| <xsd:restriction base="xsd:string"/>
| </xsd:simpleType>
|
And export-all should probably be:
| <xsd:simpleType name="export-all">
| <xsd:annotation>
| <xsd:documentation>
| <![CDATA[
| Whether to export all, valid values are:
| ALL = export every package
| NON_EMPTY = only export packages that have contents
| ]]>
| </xsd:documentation>
| </xsd:annotation>
| <xsd:restriction base="xsd:string">
| <xsd:enumeration value="ALL"/>
| <xsd:enumeration value="NON_EMPTY"/>
| </xsd:restriction>
| </xsd:simpleType>
|
What do you think? I can commit this if it's not a bad time release-wise.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4177161#4177161
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4177161
17 years, 6 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Notifications over JBM core connections
by jmesnil
As part of the management task, I'm implementing receiving management notifications over JBM core connections.
The idea is that a Core client can subscribe to notifications by asking the server to send a message to a given destination every time a notification is triggered on the server (e.g. a queue is full, a queue is added to the server)
- the client creates a "management message", a Core message with well-known properties:
* the ObjectName it wants to observe
* the destination where the notification messages must be sent (specified by the client, can be any kind of destination, more likely either a topic or a temp queue)
- it sends the message to the server
- the server handles the message
* the PostOffice detects it is a management message and pass it to the management service
* the management service creates a NotificationListener for the given ObjectName
- Later on, when a notification is received by the listener (e.g. a queue is full)
* the listener creates a Core message and fills it with the notifications information (who, when, what, etc.)
* this core message is then routed by the PostOffice according to the destination set by the client
- the client will receive the Core message and process the notification information
So, the big idea is that a Core message is created on the /server-side/ as the result of a notification (internal to the server) and not as the result of receiving a message from a client.
I'm not sure about the best way to create a Core message on the server.
The ManagementService code looks like:
| // when handling a "management message"
| final SimpleString replyTo = (SimpleString)message.getProperty(ManagementMessageImpl.HDR_JMX_REPLYTO);
| boolean subscribe = (Boolean)message.getProperty(ManagementMessageImpl.HDR_JMX_SUBSCRIBE_TO_NOTIFICATIONS);
| if (subscribe)
| {
| broadcaster.addNotificationListener(new NotificationListener() {
| public void handleNotification(Notification notification, Object handback)
| {
| ServerMessage notificationMessage = new ServerMessageImpl(0);
| notificationMessage.setDestination(replyTo);
| // FIXME no hard-coded value
| notificationMessage.setBody(new ByteBufferWrapper(ByteBuffer.allocate(1024)));
| notificationMessage.putBooleanProperty(ManagementMessageImpl.HDR_JMX_NOTIFICATION, true);
| notificationMessage.putStringProperty(new SimpleString("notif"), new SimpleString(notification.getMessage()));
| try
| {
| postOffice.route(notificationMessage);
| }
| catch (Exception e)
| {
| log.warn("problem while routing a notification message", e);
| // TODO unregister the listener for the broadcaster
| }
| }
| }, null, null);
| }
| ...
|
The code to create the notificationMessage is not correct.
I need to use a proper message ID but, on the server-side, it is the storage manager which owns the ID sequence.
I could inject the storageManager into the managementService to get access to its generateID() but it smells like a bad idea.
I could create a new POJO, a ID generator, injected in both the storageManager and the managementService.
What do you think?
Does this make sense?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4177142#4177142
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4177142
17 years, 6 months