anonymous wrote : What is meant here by bindings?
Name->Object
e.g. This would map to the implementation (remove for undeploy)
| // Get a link to the scoped metadata
| KernelMetaDataRepository kmdr = kernel.getMetaDataRepository();
| MutableMetaDataRepository mmdr = kmdr.getMutableMetaDataRepository();
| ScopeKey scope = from the <scope/>;
| MutableMetaData mmd = (MutableMetaData) mmdr.getMetaDataRetrieval(scope);
|
| // Not found create it
| if (mmd != null)
| {
| mmd = ...;
| mmdr.addMetaDataRetrieval(mmd);
| }
|
| for (iterate)
| mmd.addMetaData(name, object, object.getClass());
|
If the scope wants to define its own kernel then you would also have something like:
| // Get our scope
| KernelMetaDataRepository kmdr = kernel.getMetaDataRepository();
| MutableMetaDataRepository mmdr = kmdr.getMutableMetaDataRepository();
| ScopeKey scope = from the <scope/>;
| MutalbeMetaData mmd = (MutableMetaData) mmdr.getMetaDataRetrieval(scope);
|
| // Get the parent scope
| ScopeKey parent = scope.getParent();
| MutalbeMetaData pmmd = (MutableMetaData) mmdr.getMetaDataRetrieval(parent);
| MetaDataItem<Kernel> item = pmmd.retrieveMetaData(Kernel.class);
| Kernel kernel = null;
| if (item != null)
| kernel = item.getValue();
| else
| kernel = // use default - or more probably this current kernel?
|
| // Create a scoped kernel
| Kernel scopedKernel = new ScopedKernel(kernel);
| mmd.addMetaData(scopedKernel);
|
There is also work to do on how ScopeKeys get constructed
This is very environment specific.
See my comments on the metadata integration thread in the last couple of months.
Also note that there are two notions of scope (configuration time and runtime).
This is important in the code above where the parent kernel needs to come
from the parent runtime scope, but it is added to local configuration time scope.
Again, this difference is explained in the metadata integration thread.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009454#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...