mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
83406: ACE-2669 (Move behaviour annotation framework from RM into core) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@84552 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -28,9 +28,9 @@
|
||||
|
||||
<beans>
|
||||
|
||||
<!--
|
||||
The Shutdown Backstop Bean is a special bean which is used to terminate Alfresco if its
|
||||
normal shutdown does not complete in a reasonable time - it needs to go first so it can
|
||||
<!--
|
||||
The Shutdown Backstop Bean is a special bean which is used to terminate Alfresco if its
|
||||
normal shutdown does not complete in a reasonable time - it needs to go first so it can
|
||||
terminate any of the following beans if they misbehave.
|
||||
-->
|
||||
<bean id="shutdownBackstop" class="org.alfresco.repo.shutdown.ShutdownBackstop">
|
||||
@@ -39,8 +39,8 @@
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<value>${shutdown.backstop.enabled}</value>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="repositoryStartBootstrapBean" class="org.alfresco.repo.admin.RepositoryStartBootstrapBean" >
|
||||
<property name="repositoryState">
|
||||
@@ -131,19 +131,19 @@
|
||||
<property name="messageService" ref="messageService"/>
|
||||
<property name="tenantAdminService" ref="tenantAdminService"/>
|
||||
<property name="policyComponent" ref="policyComponent"/>
|
||||
|
||||
|
||||
<property name="repositoryModelsLocations">
|
||||
<list>
|
||||
<ref bean="customModelsRepositoryLocation" />
|
||||
</list>
|
||||
</property>
|
||||
|
||||
|
||||
<property name="repositoryMessagesLocations">
|
||||
<list>
|
||||
<ref bean="customMessagesRepositoryLocation" />
|
||||
</list>
|
||||
</property>
|
||||
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="bootstrapReEncryptor" class="org.alfresco.encryption.BootstrapReEncryptor">
|
||||
@@ -169,7 +169,7 @@
|
||||
-->
|
||||
<bean id="siteLoadBootstrap-Spaces" parent="spacesStoreImporter" singleton="true" />
|
||||
<bean id="siteLoadBootstrap-Users" parent="userStoreImporter" singleton="true" />
|
||||
|
||||
|
||||
<bean id="workflowBootstrap" parent="workflowDeployer">
|
||||
<property name="workflowDefinitions">
|
||||
<list>
|
||||
@@ -180,7 +180,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Review and Approve workflow definitions -->
|
||||
<props>
|
||||
<prop key="engineId">jbpm</prop>
|
||||
@@ -206,7 +206,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Invitation service workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">jbpm</prop>
|
||||
@@ -214,7 +214,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Invitation service workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">jbpm</prop>
|
||||
@@ -222,7 +222,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Activiti Adhoc workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">activiti</prop>
|
||||
@@ -230,7 +230,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Activiti Review workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">activiti</prop>
|
||||
@@ -238,7 +238,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Activiti Pooled Review workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">activiti</prop>
|
||||
@@ -246,7 +246,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Activiti Parallel Review workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">activiti</prop>
|
||||
@@ -254,7 +254,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Activiti Parallel Group Review workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">activiti</prop>
|
||||
@@ -262,7 +262,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Activiti invitation service workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">activiti</prop>
|
||||
@@ -270,7 +270,7 @@
|
||||
<prop key="mimetype">text/xml</prop>
|
||||
<prop key="redeploy">false</prop>
|
||||
</props>
|
||||
|
||||
|
||||
<!-- Activiti invitation service workflow definition -->
|
||||
<props>
|
||||
<prop key="engineId">activiti</prop>
|
||||
@@ -297,7 +297,7 @@
|
||||
</property>
|
||||
<property name="repositoryWorkflowDefsLocations" ref="customWorkflowDefsRepositoryLocation"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Descriptor Service -->
|
||||
<bean id="descriptorComponent" class="org.alfresco.repo.descriptor.DescriptorServiceImpl">
|
||||
<property name="serverDescriptorDAO">
|
||||
@@ -322,17 +322,17 @@
|
||||
<property name="descriptorService" ref="descriptorComponent"/>
|
||||
<property name="migrateAttrTenantsPatch" ref="patch.migrateAttrTenants"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Bootstrap any extensions -->
|
||||
|
||||
|
||||
<import resource="classpath*:alfresco/extension/bootstrap/*-context.xml" />
|
||||
|
||||
|
||||
<bean id="Transformers" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
|
||||
<property name="saveSetProperty">
|
||||
<value>true</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Start third party transformer Subsystem. -->
|
||||
<bean id="thirdparty" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
|
||||
<property name="autoStart">
|
||||
@@ -406,7 +406,7 @@
|
||||
</property>
|
||||
<property name="patch">
|
||||
<ref bean="patch.db-V4.2-metadata-query-indexes" />
|
||||
</property>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Import other Alfresco bootstrap components -->
|
||||
@@ -536,7 +536,7 @@
|
||||
<value>true</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Subscription Service subsystem -->
|
||||
<bean id="subscriptions" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean">
|
||||
<property name="category">
|
||||
@@ -546,7 +546,7 @@
|
||||
<value>true</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="SubscriptionService" class="org.alfresco.repo.management.subsystems.SubsystemProxyFactory">
|
||||
<property name="sourceApplicationContextFactory">
|
||||
<ref bean="subscriptions" />
|
||||
@@ -560,7 +560,7 @@
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Start the quartz scheduler -->
|
||||
|
||||
<bean id="schedulerStarter" class="org.alfresco.util.SchedulerStarterBean" >
|
||||
@@ -614,7 +614,7 @@
|
||||
<value>${system.usages.enabled}</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Synchronization of home folders locations to their HomeFolderProvider -->
|
||||
<bean id="homeFolderProviderSynchronizer" class="org.alfresco.repo.security.person.HomeFolderProviderSynchronizer">
|
||||
<constructor-arg ref="transactionService" />
|
||||
@@ -698,13 +698,13 @@
|
||||
<ref bean="repositoryState"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="webDavBootstrapBean" class="org.alfresco.repo.webdav.WebDavBootstrap" >
|
||||
<property name="rootNode">
|
||||
<ref bean="webdavRootNode"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="fileServerConfigurationFactory" class="org.alfresco.filesys.config.FileServerConfigurationFactory"/>
|
||||
|
||||
<!-- Startup Message -->
|
||||
@@ -719,15 +719,15 @@
|
||||
<property name="serverModeProvider">
|
||||
<ref bean="serverMode"/>
|
||||
</property>
|
||||
|
||||
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Activiti Jobexecutor -->
|
||||
<bean id="activitiEngineInitializer" depends-on="dynamicExporter"
|
||||
class="org.alfresco.repo.workflow.activiti.ActivitiEngineInitializer">
|
||||
<property name="workflowAdminService" ref="workflowAdminService" />
|
||||
</bean>
|
||||
|
||||
|
||||
<!-- Custom property editors -->
|
||||
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
|
||||
<property name="propertyEditorRegistrars">
|
||||
@@ -741,4 +741,10 @@
|
||||
class="org.alfresco.util.CustomPropertyEditorRegistrar">
|
||||
<property name="namespaceService" ref="NamespaceService"/>
|
||||
</bean>
|
||||
|
||||
<!-- Annotated behaviour bean post processor -->
|
||||
<bean id="annotatedBehaviourBeanPostProcessor" class="org.alfresco.repo.policy.annotation.AnnotatedBehaviourPostProcessor">
|
||||
<property name="policyComponent" ref="policyComponent" />
|
||||
<property name="namespaceService" ref="namespaceService" />
|
||||
</bean>
|
||||
</beans>
|
||||
|
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.policy.annotation;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.alfresco.repo.policy.JavaBehaviour;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
|
||||
/**
|
||||
* Annotated behaviour bean post processor.
|
||||
* <p>
|
||||
* Registers the annotated methods on behaviour beans with the policy component.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
* @since 5.0
|
||||
*/
|
||||
public class AnnotatedBehaviourPostProcessor implements BeanPostProcessor
|
||||
{
|
||||
/** logger */
|
||||
private static Log logger = LogFactory.getLog(AnnotatedBehaviourPostProcessor.class);
|
||||
|
||||
/** policy component */
|
||||
private PolicyComponent policyComponent;
|
||||
|
||||
/** namespace service */
|
||||
private NamespaceService namespaceService;
|
||||
|
||||
/**
|
||||
* @param policyComponent policy component
|
||||
*/
|
||||
public void setPolicyComponent(PolicyComponent policyComponent)
|
||||
{
|
||||
this.policyComponent = policyComponent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param namespaceService namespace service
|
||||
*/
|
||||
public void setNamespaceService(NamespaceService namespaceService)
|
||||
{
|
||||
this.namespaceService = namespaceService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName)
|
||||
{
|
||||
// register annotated behavior methods
|
||||
registerBehaviours(bean, beanName);
|
||||
|
||||
// return the bean
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName)
|
||||
{
|
||||
// do nothing
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register behaviours.
|
||||
*
|
||||
* @param bean bean
|
||||
* @param beanName bean name
|
||||
*/
|
||||
private void registerBehaviours(Object bean, String beanName)
|
||||
{
|
||||
if (bean.getClass().isAnnotationPresent(BehaviourBean.class))
|
||||
{
|
||||
BehaviourBean behaviourBean = bean.getClass().getAnnotation(BehaviourBean.class);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Annotated behaviour post processing for " + beanName);
|
||||
}
|
||||
|
||||
Method[] methods = bean.getClass().getMethods();
|
||||
for (Method method : methods)
|
||||
{
|
||||
if (method.isAnnotationPresent(Behaviour.class))
|
||||
{
|
||||
registerBehaviour(behaviourBean, bean, beanName, method);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register behaviour.
|
||||
*
|
||||
* @param behaviourBean behaviour bean annotation
|
||||
* @param bean bean
|
||||
* @param beanName bean name
|
||||
* @param method method
|
||||
*/
|
||||
private void registerBehaviour(BehaviourBean behaviourBean, Object bean, String beanName, Method method)
|
||||
{
|
||||
Behaviour behaviour = method.getAnnotation(Behaviour.class);
|
||||
QName policy = resolvePolicy(behaviour.policy(), method);
|
||||
QName type = resolveType(behaviourBean, behaviour);
|
||||
|
||||
// assert that the policy and type have been set!!
|
||||
ParameterCheck.mandatory("policy", policy);
|
||||
if (!behaviour.isService())
|
||||
{
|
||||
ParameterCheck.mandatory("type", type);
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
if (!behaviour.isService())
|
||||
{
|
||||
logger.debug(" ... binding " + behaviour.kind() + " behaviour for " + beanName + "." + method.getName() +
|
||||
" for policy " + policy.toString() +
|
||||
" and type " + type.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.debug(" ... binding " + behaviour.kind() + " service behaviour for " + beanName + "." + method.getName() +
|
||||
" for policy " + policy.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// create java behaviour object
|
||||
JavaBehaviour javaBehaviour = new JavaBehaviour(bean, method.getName(), behaviour.notificationFrequency());
|
||||
|
||||
// determine whether we should register the behaviour
|
||||
if (bean instanceof BehaviourRegistry && !behaviour.name().isEmpty())
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug(" ... adding behaviour to registry with name " + behaviour.name());
|
||||
}
|
||||
|
||||
((BehaviourRegistry)bean).registerBehaviour(behaviour.name(), javaBehaviour);
|
||||
}
|
||||
|
||||
// deal with class behaviours
|
||||
if (BehaviourKind.CLASS.equals(behaviour.kind()))
|
||||
{
|
||||
if (!behaviour.isService())
|
||||
{
|
||||
// bind class behaviour for given type
|
||||
policyComponent.bindClassBehaviour(policy, type, javaBehaviour);
|
||||
}
|
||||
else
|
||||
{
|
||||
// bind class service behaviour
|
||||
policyComponent.bindClassBehaviour(policy, bean, javaBehaviour);
|
||||
}
|
||||
}
|
||||
// deal with association behaviours
|
||||
else if (BehaviourKind.ASSOCIATION.equals(behaviour.kind()))
|
||||
{
|
||||
if (!behaviour.isService())
|
||||
{
|
||||
// bind association behaviour for given type and assoc type
|
||||
policyComponent.bindAssociationBehaviour(policy,
|
||||
type,
|
||||
toQName(behaviour.assocType()),
|
||||
javaBehaviour);
|
||||
}
|
||||
else
|
||||
{
|
||||
// bind association service behaviour
|
||||
policyComponent.bindAssociationBehaviour(policy, bean, javaBehaviour);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the policy qname, defaulting to the qualified name of the method if none specified.
|
||||
*
|
||||
* @param policyName policy name
|
||||
* @param method method
|
||||
* @return {@link QName} qualified name of the policy
|
||||
*/
|
||||
private QName resolvePolicy(String policyName, Method method)
|
||||
{
|
||||
QName policy = null;
|
||||
if (policyName.isEmpty())
|
||||
{
|
||||
policy = QName.createQName(NamespaceService.ALFRESCO_URI, method.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
policy = toQName(policyName);
|
||||
}
|
||||
|
||||
return policy;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param behaviourBean
|
||||
* @param typeName
|
||||
* @return
|
||||
*/
|
||||
private QName resolveType(BehaviourBean behaviourBean, Behaviour behaviour)
|
||||
{
|
||||
QName type = null;
|
||||
if (!behaviour.isService())
|
||||
{
|
||||
if (behaviour.type().isEmpty())
|
||||
{
|
||||
// get default
|
||||
type = toQName(behaviourBean.defaultType());
|
||||
}
|
||||
else
|
||||
{
|
||||
// convert set
|
||||
type = toQName(behaviour.type());
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
private QName toQName(String name)
|
||||
{
|
||||
return QName.createQName(name, namespaceService);
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.policy.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.alfresco.repo.policy.Behaviour.NotificationFrequency;
|
||||
|
||||
/**
|
||||
* Behaviour method annotation.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
* @since 5.0
|
||||
*/
|
||||
@Target(value = ElementType.METHOD)
|
||||
@Retention(value = RetentionPolicy.RUNTIME)
|
||||
public @interface Behaviour
|
||||
{
|
||||
/** lookup name of the behaviour, if none specified behaviour is not recorded in the registry */
|
||||
String name() default "";
|
||||
|
||||
/** kind of behaviour */
|
||||
BehaviourKind kind();
|
||||
|
||||
/** qualified name of policy */
|
||||
String policy() default "";
|
||||
|
||||
/** indicates whether this is a service behaviour or not */
|
||||
boolean isService() default false;
|
||||
|
||||
/** qualified name of type/aspect */
|
||||
String type() default "";
|
||||
|
||||
/** qualified name of association */
|
||||
String assocType() default "cm:contains";
|
||||
|
||||
/** notification frequency */
|
||||
NotificationFrequency notificationFrequency() default NotificationFrequency.EVERY_EVENT;
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.policy.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @author Roy Wetherall
|
||||
* @since 5.0
|
||||
*/
|
||||
@Target(value = ElementType.TYPE)
|
||||
@Retention(value = RetentionPolicy.RUNTIME)
|
||||
public @interface BehaviourBean
|
||||
{
|
||||
/** qualified name of type/aspect */
|
||||
String defaultType() default "";
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.policy.annotation;
|
||||
|
||||
/**
|
||||
* Enumeration describing the different kinds of behaviour.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
* @since 5.0
|
||||
*/
|
||||
public enum BehaviourKind
|
||||
{
|
||||
CLASS,
|
||||
ASSOCIATION
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.repo.policy.annotation;
|
||||
|
||||
import org.alfresco.repo.policy.Behaviour;
|
||||
|
||||
/**
|
||||
* Interface for a behaviour registry.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
* @since 5.0
|
||||
*/
|
||||
public interface BehaviourRegistry
|
||||
{
|
||||
/**
|
||||
* Register a behaviour against a given name.
|
||||
*
|
||||
* @param behaviour behaviour
|
||||
*/
|
||||
void registerBehaviour(String name, Behaviour behaviour);
|
||||
|
||||
/**
|
||||
* Gets the behaviour for a given name.
|
||||
*
|
||||
* @param name behaviour name
|
||||
* @return {@link Behaviour} behaviour, null otherwise
|
||||
*/
|
||||
Behaviour getBehaviour(String name);
|
||||
}
|
Reference in New Issue
Block a user