Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] Constructing new contexts with IdAS

I am just sitting together with Valery, and I think he has proposed a few times already that IdAS needs a way of creating completely new contexts (not just instantiating). Since this also requires creating a new context ID, this process would involve the IdASRegistry. We came up with the following proposal:

1) Add this method to IContextFactory:
Map createNewContext(Map configuration)

The passed Map would contain the configuration necessary to create the new context. The returned map contains configuration that's needed later to re-instantiate the context. This returned map is not necessarily the same as the map passed as a parameter, but may be the same in some cases.

This method is mainly intended to be used by the following.

2) Add this method to IdASRegistry:
IContextId createNewContext(String type, Map configuration)

This would look up a suitable context factory for the given type, call createNewContext on the context factory (passing the configuration), and then create a new IContextId which can be used later to re-instantiate the context. This would create a new local XRDS file by default, but may involve other ways of creating a context ID at a later point. If desired, the IContextId can be toString()ed and later constructed again by calling ContextIdFactory.fromString().

Feedback?

Markus


Back to the top