[Design of POJO Server] - Persisted mgmt edits not applied to AbstractBeanMetaData
by bstansberry@jboss.com
I'm experimenting with applying edits via the ManagementView to ServiceBindingManager (see http://www.jboss.org/index.html?module=bb&op=viewtopic&t=154673 for changes I've made locally to set this up.) I'm finding that my edits are persisted, but when I restart the AS they are not being applied.
Problem seems to be the type of attachment is not being looked for. Here's how ProfileServicePersistenceDeployer looks for relevant attachments:
| protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
| {
| // Check all attachments, if they have a managed attachment
| // TODO there might be a better way to do that ? :)
| Set<String> attachments = unit.getTransientManagedObjects().getAttachments().keySet();
| for(String attachment : attachments)
| {
| PersistedManagedObject persistedManagedObject = (PersistedManagedObject) unit.getAttachment(PERSISTED_ATTACHMENT_PREFIX + attachment);
|
| if(persistedManagedObject != null)
| ... do stuff to apply persisted edits
|
The "attachments" set includes:
org.jboss.kernel.spi.deployment.KernelDeployment, org.jboss.deployers.spi.structure.StructureMetaData
Problem is the LazyPredeterminedManagedObjects.attachments set only includes
org.jboss.beans.metadata.plugins.AbstractBeanMetaData
So, no match and thus no edits applied.
Any ideas on what could be going wrong? The persisted attachment metadata is as follows:
bindings-jboss-beans-XXX/metadata-attachment.xml:
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
| <attachments-metadata xmlns="urn:org:jboss:profileservice:attachments:1.0">
| <attachment>
| <attachment-class-name>org.jboss.beans.metadata.plugins.AbstractBeanMetaData</attachment-class-name>
| <attachment-name>org.jboss.services.binding.ServiceBindingManager</attachment-name>
| </attachment>
| <deployment-name>bindings-jboss-beans.xml</deployment-name>
| <deployment-structure>
| <relative-order>0</relative-order>
| </deployment-structure>
| <last-modified>1241122388193</last-modified>
| </attachments-metadata>
bindings-jboss-beans-XXX/org.jboss.services.binding.ServiceBindingManager.attachment.xml:
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
| <managed-object xmlns="urn:org:jboss:profileservice:persistence:managed-object:1.0" template-name="org.jboss.services.binding.ServiceBindingManager" name="ServiceBindingManager" class-name="org.jboss.beans.metadata.plugins.AbstractBeanMetaData">
| <orignal-name>ServiceBindingManager</orignal-name>
| <properties>
| <property name="serverName">
| <simple>ports-01</simple>
| </property>
| </properties>
| </managed-object>
(BTW, there's a typo in that last snippet: "orignal-name")
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227924#4227924
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227924
15 years, 7 months
[Design of POJO Server] - JBBOOT - Event listener and ServerInitializer APIs
by jaikiran
Moving the email discussion with ALR, to the forum:
"jaikiran" wrote : > Hi Andrew,
| >
| >
| > I was working on the JBBOOT-54 and had a few related questions:
| >
| > 1) In MCServer (impl-mc) what is the right time to expect the Kernel within the MC to be "set". Right now i see that it's being set during doStart() which is too late if someone wants to register to kernel events. I have this failing testcase (not committed) http://pastebin.com/m3979391c This fails because the kernel is not set.
|
"ALR" wrote :
| Yep, I moved the bootstrap.run() and setup of the Kernel into the
| initialize() method of AbstractMcServerBase.
|
| Commits: http://fisheye.jboss.org/changelog/JBossAS/?cs=87976
|
"jaikiran" wrote :
| > 2) I am bad (just learning more) at generics, this is more of a "is there a better way to do this" question - The LifecycleEventHandler has the following API:
| >
| > public void handleEvent(Server<MCServer, MCServerConfig> server, LifecycleState state) throws LifecycleEventException
| >
| > Assuming that the client registers a event handler for a MCServer event http://pastebin.com/m298f9c41is there a better was to work on a MCServer in the handleEvent method instead of doing a cast (line 26 in pastebin)? More importantly are there chances of getting a different type of server (i believe not, else it would be a bug), when the event handler was registered for MCServer?
|
"ALR" wrote :
| The Lifecycle Event Handling API was stupid, because there's no need to
| pass the server back into handleEvent(). So I removed this. Event
| handlers that need to get at the server or Kernel (or whatever) can make
| that an implementation detail supplied in the ctor, like:
|
| [url]http://fisheye.jboss.org/browse/JBossAS/projects/bootstrap/trunk/impl...
| [/url]
| Regarding your question about the generics, clearly they're wrong. And the same pattern is used in ServerInitializer. So I've got to revisit this and keep type safety (ideas welcome).
|
"jaikiran" wrote : > P.S: Is there an appropriate forum (user/dev) where we could discuss such questions?
|
"ALR" wrote :
| Sure, we can abuse Design of POJO Server. Mind posting your questions and my responses there?
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227860#4227860
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227860
15 years, 7 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Another security configuration issue
by gaohoward
Hi Andy, here I rephrase my thought.
Actuall it is about how the SecurityDeployer works with wild cards. Again let's take this config:
| <security match="jms.topic.#">
| <permission type="createDurableQueue" roles="user"/>
| <permission type="deleteDurableQueue" roles="user"/>
| <permission type="createTempQueue" roles="user"/>
| <permission type="deleteTempQueue" roles="user"/>
| <permission type="send" roles="user"/>
| <permission type="consume" roles="user"/>
| </security>
|
| <security match="jms.topic.news.europe.#">
| <permission type="send" roles="europe-user"/>
| <permission type="consume" roles="news-user"/>
| </security>
|
| <security match="jms.topic.news.us.#">
| <permission type="send" roles="us-user"/>
| <permission type="consume" roles="news-user"/>
| </security>
|
Here we have three security elements. There match strings are
| jms.topic.#
| jms.topic.news.europe.#
| jms.topic.news.us.#
|
Suppose we deploy the above config into SecurityDeployer. Given a topic whose address is 'jms.topic.news.europe.europeTopic', what if we call
| HashSet roles = SecurityDeployer.securityRepository.getMatch('jms.topic.news.europe.europeTopic');
|
What's interesting is that 'jms.topic.news.europe.europeTopic' matches both 'jms.topic.#' and 'jms.topic.news.europe.#'. So I expect
that it will return three roles: user, europe-user and news-user. But it actually returns 2 - europe-user and news-user.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227858#4227858
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227858
15 years, 7 months