It is already possible to attach behaviors to composite components that are retargeted to via <cc:clientBehavior> but is not possible to attach a behavior directly to a composite component, with no target).
UINamingContainer should implement ClientBehaviorHolder and support decoding of behaviors. It should be possible to configure the supported events using the <cc:clientBehavior> with no "name" attribute or maybe with the special keyword "@this" in the "targets" attribute.
The script of a behavior could be made available in the composite component implementation for example via an EL expression.
<cc:clientBehavior event="focus" />