Skip to Content.
Sympa Menu

grouper-dev - Re: [grouper-dev] Action Items: Grouper-Dev Call 9-Jul-2008

Subject: Grouper Developers Forum

List archive

Re: [grouper-dev] Action Items: Grouper-Dev Call 9-Jul-2008

Chronological Thread 
  • From: Tom Barton <>
  • To: Chris Hyzer <>
  • Cc: "" <>
  • Subject: Re: [grouper-dev] Action Items: Grouper-Dev Call 9-Jul-2008
  • Date: Thu, 10 Jul 2008 07:40:48 -0500

Now I get it. This is an elegant solution to the problem of multiple hook developers with differing purposes.

How is the sequence of hook firing determined? What if a hook must be last, or first, or must override others?

Chris Hyzer wrote:
[AI] {Chris} will write an explanation of how hooks will be declared.

I added 3 Grouper lifecycle hooks, for grouper init, hooks init, and
hibernate init.

So now there are 3 ways to configure hooks, by declaring piecemeal in, by declaring one lifecycle hook which registers a
suite of hooks in java in the hooks init method, or I picture built
in grouper hooks / suites being declared in java and configured
(turned on and off perhaps) in the (when someone
wants to do this the first time I can do an example, just let me know
the lifecycle hooks class and setting). This
built in way would not require classes of hooks or lifecycles
configured in the (we will leave that for user
hooks or 3rd party hooks).

I documented these on the hooks page:


#### from documentation ####

To configure a hook, subclass one of the hooks base classes, e.g. GroupHooks,
MembershipHooks, etc. Then either register this in the
(see for documentation)

#implement a group hook by extending

Note you can register multiple hooks by comma separating them. Or you can
register runtime with:


If you want to register a suite of hooks, just register a lifecycle hook:


Then in the hook init method, register some hooks for the suite:

package edu.internet2.middleware.grouper.hooks;

import edu.internet2.middleware.grouper.hooks.beans.HooksContext;
import edu.internet2.middleware.grouper.hooks.logic.GrouperHooksUtils;

public class LifecycleHooksImpl extends LifecycleHooks {

* @see
public void hooksInit(HooksContext hooksContext,
HooksLifecycleHooksInitBean hooLifecycleHooksInitBean) {
GrouperHooksUtils.addHookManual("", MyGroupHooks.class);
GrouperHooksUtils.addHookManual("hooks.stem.class", MyStemHooks.class);


Finally, I picutre built-in grouper suites to just insert the
registration based on grouper config property in GrouperHooksUtils in
the initHooks block. To enable the suite the grouper properties file
would just have a boolean switch. When someone wants to get this
working, let me know the grouper properties config property and the
LifecycleHooks subclass and I can do an example.

Archive powered by MHonArc 2.6.16.

Top of Page