[Design the new POJO MicroContainer] - Re: Changing the way AbstractVFSDeployment serializes root
by alesj
"alesj" wrote :
| Or I can leave this one?
| Since how many times do we expect the root to be Memory VirtualFile? :-)
I've added this to AbstractVFSDeployment:
| /**
| * Should we serialize root directly.
| * e.g. the root is memory virtual file instance
| * @see org.jboss.virtual.plugins.context.memory.MemoryContextHandler
| *
| * @param directRootSerialization the direct root serialization flag
| */
| public void setDirectRootSerialization(boolean directRootSerialization)
| {
| this.directRootSerialization = directRootSerialization;
| }
|
| public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
| {
| super.readExternal(in);
| directRootSerialization = in.readBoolean();
| if (directRootSerialization)
| root = (VirtualFile)in.readObject();
| else
| {
| VirtualFileSerializator serializator = (VirtualFileSerializator)in.readObject();
| root = serializator.getFile();
| }
| }
|
| public void writeExternal(ObjectOutput out) throws IOException
| {
| super.writeExternal(out);
| out.writeBoolean(directRootSerialization);
| if (directRootSerialization)
| out.writeObject(root);
| else
| out.writeObject(new VirtualFileSerializator(root));
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170293#4170293
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170293
17 years, 7 months
[Design the new POJO MicroContainer] - Re: Changing the way AbstractVFSDeployment serializes root
by alesj
"scott.stark(a)jboss.org" wrote : I suppose that is true regardless of how serialization is done.
|
"alesj" wrote :
| I think this is the right way to do it anyway.
|
| If you would like to have full structure already present, I don't think you would gain much, since you would then 'pay' huge on transport, instead of at re-creation.
Thinking about it a bit more + hitting Memory VirtualFile issue,
this looks like wrong approach. :-(
Why?
e.g. having Memory VirtualFile, we know how to serialize it -
passing info from server to client, since we transfer bytes that make
up that Memory VirtualFile, where in the case of root+path approach,
that won't work - client JVM doesn't know anything about it.
Hence, I'll revert my changes:
- https://jira.jboss.org/jira/browse/JBDEPLOY-48
- https://jira.jboss.org/jira/browse/JBDEPLOY-72
Although I saw Dimitris increased memory for smoke-tests,
I think we should properly fix how tests access server side deployments.
I believe there's already a JIRA issue about that,
assigned to Shelly if my memory serves me correctly?
But I can go ahead and fix it,
just need to know what I should use - ProfileService or DeploymentManager?
Or do we even have full API to port previous access code?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170289#4170289
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170289
17 years, 7 months
[Design the new POJO MicroContainer] - Re: JBMICROCONT-330 - Preconfigured MDR and scopes
by alesj
"adrian(a)jboss.org" wrote :
| When you create the ControllerContext from the Component,
| you copy the GUID.
|
OK, makes sense.
But still makes it hard to create some predetermined INSTANCE scope metadata,
since it's again, how are gonna know which GUID is the one you actually want from a set of GUIDs from components.
e.g.
| <deployment>
| <bean name="simple" class="org.jboss.acme.Simple"/>
|
| <bean name="simple" class="org.jboss.acme.Simple">
| <annotation>@org.jboss.acme.SomeScopeAnnotation("myscope")</annotation>
| </bean>
| </deployment>
|
And now I want to add some predetermined INSTANCE metadata to 2nd bean.
How am I gonna know which GUID is assigned to its component?
Unless I do some detailed lookup, e.g. Component --> BeanMetaData --> annotations --> are they scope annotations ---> ...
And you cannot do any MDR modification before Real deployment phase,
since the components are not there yet - no GUID.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170281#4170281
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170281
17 years, 7 months
[Design the new POJO MicroContainer] - Re: MDR doesn't work on annotated privates
by wolfc
"adrian(a)jboss.org" wrote : The idea is that eventually MDR will support loading annotations before the
| class is loaded, e.g. for AOP using javassist in that case
| you can't use the Method as the key, you've got to use the "signature".
Got it, so putting ejb3 meta data bridge onto Method is wrong.
"adrian(a)jboss.org" wrote : Of course, people that use it at runtime can still use the Method.
|
| Your problem is that there is no way to define @Inherited for a non-class Annotation.
| http://java.sun.com/j2se/1.5.0/docs/api/java/lang/annotation/Inherited.html
|
| Sub.class.getMethod("postConstruct").getAnnotation(PostConstruct.class) == null
| is the correct behaviour absent some other semantic/hack
| and therefore it should be the behaviour of the MetaData.
Ah, but
Sub.class.getDeclaredMethod("postConstruct").getAnnotation(PostConstruct.class) != null
which is what I'm interested in.
"adrian(a)jboss.org" wrote : We could try to simulate this behaviour where you could configure
| somewhere that @PostConstruct should do an @Inherited like behaviour
| at the method level then make the
| AnnotatedElementMetaDataLoader
| do the extra work for those annotations.
Well in actuality AnnotatedElementMetaDataLoader already works as I would expect it: http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas?view=rev&revision=76978. But because of the semantics of MethodSignature it's luck and not design that drives this (JBMDR-28 being the four-leaf clover).
"adrian(a)jboss.org" wrote : I remember discussing this issue about 6 months ago?
| e.g. whether it should also search interfaces (with the multiple inheritance
| problem it would cause) but nothing came of the discussion.
I missed that one.
I think we need a DeclaredMethodSignature. That should also solve the interfaces issue. Then I can put ejb3 meta data bridge on that one.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170278#4170278
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170278
17 years, 7 months