abstract class IdentityMixin<T extends HasIdentity> implements ServerResource<T> { @This private Parameters<T> parameters; @Service private IdentityManager identityManager; @Override public Identity identity() { return identityManager.generate( parameters.entityType().get(), parameters.id().get() ); } }
public static abstract class AnotherValueMixin implements AnotherValue { @This private AnotherValueInternalState internalState; @Override public String internalVal() { return internalState.val2().get(); } }
public TimingCaptureConcern( @Structure Module module, @Service @Optional MetricsProvider metrics, @Invocation Method method ) { super( module, metrics, method ); }
public abstract static class TestMixin1 implements TestComposite1 { @Structure Module module; public Module getModule() { return module; } }
class Mixin implements MyEntity { @Service private YourService service; @Override public void logic() { YourEntity result = service.get(); } } }
public static class A { @Uses B b; }
public static class HelloWorldMixin implements HelloWorld { @This Configuration<HelloWorldConfiguration> config; public String sayHello() { return config.get().phrase() + " " + config.get().name(); } } }
public TimingCaptureConcern( @Structure Module module, @Service @Optional MetricsProvider metrics, @Invocation Method method ) { super( module, metrics, method ); }
public abstract static class TestMixin2 implements TestComposite2 { @Structure Module module; public Module getModule() { return module; } }
public static class MyMixin implements My { @This Configuration<MyConfiguration> config; @Override public String doSomething() { return config.get().data().get(); } } }
static public class B { @Uses C c; }
public abstract static class SomeMixin implements SomeValue { @This private SomeInternalState state; @Override public String name() { return state.name().get(); } }
public abstract static class SomeMixin implements Some { @This private Other other; public String method() { other.other(); return "method()"; } }
class PetMixin implements Pet { @This PetState state; public void changeOwner( Person owner ) { state.owner().set( owner ); } } }
public static class AMixin implements A { @This B bRef; public String doStuff() { return bRef.otherStuff() + "123"; } }
public class EmptyCassandraTableMixin implements CanRemoveAll { @This private CassandraCluster cluster; @Override public void removeAll() { cluster.cassandraClientSession().execute( "TRUNCATE TABLE " + cluster.tableName() + ";"); } }
class Mixin implements TestActivation { @This Configuration<TestConfiguration> config; public void printConfig() { System.out.println( "Activate service:" + config.get().stringConfig().get() ); } }
public static abstract class FooServiceMixin implements FooServiceComposite { @This private Configuration<FooConfigurationComposite> config; public String configuredFoo() { return config.get().foo().get(); } }