You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "Kyle Marvin (JIRA)" <be...@incubator.apache.org> on 2005/02/25 22:00:48 UTC
[jira] Created: (BEEHIVE-365) Enable optional declarative contextual services
Enable optional declarative contextual services
-----------------------------------------------
Key: BEEHIVE-365
URL: http://issues.apache.org/jira/browse/BEEHIVE-365
Project: Beehive
Type: Improvement
Components: Controls
Versions: V1Beta
Reporter: Kyle Marvin
Priority: Minor
Fix For: V1Beta
It would be nice to be able to declaratively specify a contextual service whose presence is optional. Currently, if a service isn't available a ControlException will be thrown during impl initialization.
Having a 'soft failure' mode where no exception is thrown but the service ref is left null would allow:
- user code to generate a more specific and useful error message in an onCreate handler if a needed service is unavailable.
- allow user (or test) code to be written that behaves conditionally based upon whether certain contextual services are/are not available
The default value of 'required' would be true, meaning that if the attribute was not present on an @Context declaration, the behavior would be identical to what it is today (bean instantiation will fail).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (BEEHIVE-365) Enable optional declarative contextual services
Posted by "Kenneth Tam (JIRA)" <be...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/BEEHIVE-365?page=history ]
Kenneth Tam updated BEEHIVE-365:
--------------------------------
Assign To: Kyle Marvin
Fix Version: V1
(was: V1Beta)
> Enable optional declarative contextual services
> -----------------------------------------------
>
> Key: BEEHIVE-365
> URL: http://issues.apache.org/jira/browse/BEEHIVE-365
> Project: Beehive
> Type: Improvement
> Components: Controls
> Versions: V1Beta
> Reporter: Kyle Marvin
> Assignee: Kyle Marvin
> Priority: Minor
> Fix For: V1
>
> It would be nice to be able to declaratively specify a contextual service whose presence is optional. Currently, if a service isn't available a ControlException will be thrown during impl initialization.
> Having a 'soft failure' mode where no exception is thrown but the service ref is left null would allow:
> - user code to generate a more specific and useful error message in an onCreate handler if a needed service is unavailable.
> - allow user (or test) code to be written that behaves conditionally based upon whether certain contextual services are/are not available
> The default value of 'required' would be true, meaning that if the attribute was not present on an @Context declaration, the behavior would be identical to what it is today (bean instantiation will fail).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
[jira] Updated: (BEEHIVE-365) Enable optional declarative contextual services
Posted by "Kyle Marvin (JIRA)" <be...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/BEEHIVE-365?page=all ]
Kyle Marvin updated BEEHIVE-365:
--------------------------------
Fix Version: TBD
(was: V1)
Pushing this minor feature out to a future release, there is a simple workaround, which is use to use BeanContextServices API on ControlBeanContext to query the existence of a service, as follows:
@Context ControlBeanContext context;
...
TheService service = context.getService(TheService.class,
null);
if (service == null)
{
// service unavailable in execution context
}
else
{
// service available in execution context
}
> Enable optional declarative contextual services
> -----------------------------------------------
>
> Key: BEEHIVE-365
> URL: http://issues.apache.org/jira/browse/BEEHIVE-365
> Project: Beehive
> Type: Improvement
> Components: Controls
> Versions: V1Beta
> Reporter: Kyle Marvin
> Assignee: Kyle Marvin
> Priority: Minor
> Fix For: TBD
>
> It would be nice to be able to declaratively specify a contextual service whose presence is optional. Currently, if a service isn't available a ControlException will be thrown during impl initialization.
> Having a 'soft failure' mode where no exception is thrown but the service ref is left null would allow:
> - user code to generate a more specific and useful error message in an onCreate handler if a needed service is unavailable.
> - allow user (or test) code to be written that behaves conditionally based upon whether certain contextual services are/are not available
> The default value of 'required' would be true, meaning that if the attribute was not present on an @Context declaration, the behavior would be identical to what it is today (bean instantiation will fail).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira