mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged HEAD (5.1) to 5.1.N (5.1.1)
117489 bhorje: CM-690 extensions git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@117573 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
|
||||
package org.alfresco.traitextender;
|
||||
|
||||
import org.alfresco.traitextender.Extend;
|
||||
import org.alfresco.traitextender.ExtendedTrait;
|
||||
import org.alfresco.traitextender.Extensible;
|
||||
import org.alfresco.traitextender.AJProxyTrait;
|
||||
import org.alfresco.traitextender.Trait;
|
||||
|
||||
public class TestPublicService implements Extensible
|
||||
{
|
||||
private final ExtendedTrait<TestPublicTrait> testPublicTrait;
|
||||
|
||||
public TestPublicService()
|
||||
{
|
||||
this.testPublicTrait=new ExtendedTrait<TestPublicTrait>(AJProxyTrait.create(this, TestPublicTrait.class));
|
||||
}
|
||||
|
||||
@Extend(traitAPI = TestPublicTrait.class, extensionAPI = TestPublicExtension.class)
|
||||
public String publicMethod1(String s)
|
||||
{
|
||||
return "PM1" + s;
|
||||
}
|
||||
|
||||
@Extend(traitAPI = TestPublicTrait.class, extensionAPI = TestPublicExtension.class)
|
||||
public String publicMethod2(String s)
|
||||
{
|
||||
return "PM2" + s;
|
||||
}
|
||||
|
||||
@Extend(traitAPI = TestPublicTrait.class, extensionAPI = TestPublicExtension.class)
|
||||
public void publicMethod3(boolean throwException, boolean throwExException) throws TestException
|
||||
{
|
||||
if (throwException) { throw new TestException(); }
|
||||
|
||||
}
|
||||
|
||||
@Extend(traitAPI = TestPublicTrait.class, extensionAPI = TestPublicExtension.class)
|
||||
public void publicMethod4(boolean throwRuntimeException, boolean throwExRuntimeException)
|
||||
{
|
||||
if (throwRuntimeException) { throw new TestRuntimeException(); }
|
||||
}
|
||||
|
||||
@Override
|
||||
public <M extends Trait> ExtendedTrait<M> getTrait(Class<? extends M> traitAPI)
|
||||
{
|
||||
return (ExtendedTrait<M>) testPublicTrait;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user