@Config(name="B") public static class B { private String name; public B () { } public B (String name) { this.name = name; } public String getName() { return name; } }
@Config(name="A") public static class A { private String name; public A () { } public A (String name) { this.name = name; } public String getName() { return name; } }
@Config(name = SINGLETON_PARENT_SCHEMA_NAME, desc = "") public static class SingletonParent { @Config(desc = "") private Singleton singleton; @Config(desc = "") private String property; public SingletonParent() { } public String getProperty() { return property; } public Singleton getSingleton() { return singleton; } public void setSingleton(Singleton singleton) { this.singleton = singleton; } }
@Config(name = SINGLETON_SCHEMA_NAME, desc = "") public static class Singleton { @Config(desc = "") private String property; @Config(desc="") private Parent parent; public BeanId getBeanId() { return BeanId.createSingleton(SINGLETON_SCHEMA_NAME); } public String getProperty() { return property; } public Parent getParent() { return parent; } public void setProperty(String property) { this.property = property; } }
@Config(name = "person", desc = "desc") public static class Person { @Id(desc = "") private String id; @Config(desc = "") private Person bestFriend; @Config(desc = "") private List<Person> closeFriends = new ArrayList<>(); @Config(desc = "") private Map<String, Person> colleauges = new HashMap<>(); public Person(String id) { this.id = id; } public Person() { } }
@Config(name = "CdiSingletonConfig", desc = "A cdi enabled lookup configuration") @ConfigScope public class CdiSingletonConfig { @Config(desc = "value") private String value = "value"; public CdiSingletonConfig() { } public CdiSingletonConfig(String value) { this.value = value; } public String getValue() { return value; } }
@ConfigScope @Config(name = "cluster", desc = "Server cluster configuration. Changes requires server restart.") public class ClusterConfig { @Config(desc="Server that are configured as members of this cluster.") private List<ServerConfig> servers = new ArrayList<>(); public List<ServerConfig> getServers() { return servers; } public void setServers(List<ServerConfig> servers) { this.servers = servers; } public void addServer(ServerConfig server) { servers.add(server); } }
@Config(name = "web", desc = "Static web configuration. Changes requires server restart.") @ConfigScope public class WebConfig { @Config(desc = "URI where static web content is mounted.") @NotNull private String uri = "/"; public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } }
@Config(name = "jobs", desc = "Configuration for a specific job") public class JobConfig { @Id(desc = "id") private String id; @Config(desc = "Cron expression used for job scheduling.") private String cronExpression; public JobConfig() { } public JobConfig(String id) { this.id = id; } public String getId() { return id; } public String getCronExpression() { return cronExpression; } }
@Config(name = "job", desc = "Job scheduler configuration. Changes requires restart.") @ConfigScope public class JobSchedulerConfig { @Config(desc = "See org.quartz.scheduler.instanceName") private String instanceName = "QuartzScheduler"; @Config(desc = "See org.quartz.scheduler.instanceId") private String instanceId = "AUTO"; @Config(desc = "See org.quartz.jobStore.isClustered") private Boolean isClustered = true; @Config(desc = "See org.quartz.scheduler.idleWaitTime") private Long idleTimeWait = 5000L; @Config(desc = "See org.quartz.scheduler.dbFailureRetryInterval") private Long dbFailureRetryInterval = 15000L; @Config(desc = "See org.quartz.jobStore.clusterCheckinInterval") private Long clusterCheckinInterval = 7500L; @Config(desc = "See org.quartz.scheduler.batchTriggerAcquisitionMaxCount") private Integer batchTriggerAcquisitionMaxCount = 10; @Config(desc = "See org.quartz.scheduler.batchTriggerAcquisitionFireAheadTimeWindow") private Long batchTriggerAcquisitionFireAheadTimeWindow = 0L;
@ConfigScope @Config(name = "executor", desc = "Thread pool executor. Changes requires server restart.") public class ExecutorConfig { @Config(desc = "The maximum number of active threads.") @NotNull @Size(min = 1, max = 65535) private Integer corePoolSize = 20; @Config(desc = "The maximum total size of the queued events in bytes. 0 to disable.") @NotNull private Long maxChannelMemorySize = 1048560L; @Config(desc = "The maximum total size of the queued events. 0 to disable.") @NotNull private Long maxTotalMemorySize = 16776960L; @Config(desc = "The amount of time for an inactive thread to shut itself down in seconds.") @NotNull private Integer keepAliveTime = 60;
@Config(name = "binarytree", desc = "A binary tree") @BinaryTreeConstraint public class BinaryTree { private String id; @Config(desc = "value of the current tree") @NotNull private Integer value; @Config(desc = "parent tree") private BinaryTree parent; @Config(desc = "left tree") private BinaryTree left; @Config(desc = "right tree") private BinaryTree right;
@Config(name="jpa") @ConfigScope public class JpaConfig { @Config(name = JPA_UNIT) private String unit = JPA_UNIT_DEFAULT; @Config(name = USER) private String user; @Config(name = PASSWORD) private String password; @Config(name = URL) private String url; @Config(name = DRIVER) private String driver; @Config(name = PROVIDER) private String provider = "org.hibernate.ejb.HibernatePersistence"; @Config(name = TX_TYPE) private String txType = "RESOURCE_LOCAL"; @Config(name = VALIDATION_MODE) private String validationMode; @Config(name = VALIDATION_PRE_PERSIST)
@Config(name = CHILD_SCHEMA_NAME, desc = "a test class") public static class Child { @Config(desc = "prop1Desc") private String prop1; @Config(desc = "prop2Desc") private Set<String> prop2; @Config(desc = "prop3Desc") private List<Integer> prop3 = Arrays.asList(1, 2, 3); @Config(desc = "prop4Desc") private DateTime prop4; @Config(desc = "prop5Desc") private DurationTime prop5; @Config(desc = "prop8Desc") private Byte prop8; @Min(1) @Config(desc = "prop9Desc") private long prop9 = 100000000; @Config(desc = "prop10Desc") private Short prop10; @Config(desc = "prop11Desc") private Float prop11; @Config(desc = "prop12Desc") private Double prop12; @Config(desc = "prop13Desc") private Boolean prop13; @Config(desc = "prop15Desc") private URL prop15; @Config(desc = "prop16Desc") private File prop16;
@ConfigScope @Config(name="websocket", desc="Websocket configuration. Changes requires restart.") public class SockJsConfig { private String serverName = ServerConfig.DEFAULT_SERVER_NAME; @Config(desc="Http port for SockJS server.") private Integer httpPort = DEFAULT_HTTP_PORT; @Config(desc="Port for SockJS eventbus.") private Integer eventBusPort = DEFAULT_EVENTBUS_PORT;
@Config(name = "application", desc = "application") public class ApplicationConfig { @Id(desc = "westty application identification") private String id; @Config(desc = "URI where application is mounted.") @NotNull private String appUri = "/"; @Config(desc = "URI where jaxrs services are mounted.") @NotNull private String jaxrsUri = "/"; @Config(desc = "URI where static web content is mounted.") @NotNull private String staticUri = "/"; @Config(desc = "Path on file system where static web content is served from.") @NotNull private String staticRoot; @Config(desc = "URI where websockets are mounted.") @NotNull private String websocketUri = "/";
@Config(name="datasource") @ConfigScope public class DataSourceConfig { private String password = "westty"; private String user = "westty"; private String driver = "org.apache.derby.jdbc.EmbeddedDriver"; private String url ="jdbc:derby:memory:westty;create=true"; public DataSourceConfig() { } public String getPassword() { return password; } public String getUser() { return user; } public String getDriver() { return driver; } public String getUrl() { return url; } }
@ConfigScope @Config(name = "protobuf", desc = "Protobuf configuration. Changes requires server restart.") public class ProtobufConfig { @Config(desc = "Protobuf listening port.") @NotNull @Min(0) private Integer port = 7777; @Config(desc = "Specify the worker count to use. " + "See netty javadoc NioServerSocketChannelFactory.") @Min(1)
@ConfigScope @Config(name = "servers", desc = "Server engine configuration. Changes requires server restart.") public class ServerConfig { @Config(desc = "Public Ip Address.") private String publicIp = DEFAULT_IP_ADDRESS; @Config(desc = "Private Ip Address.") private String privateIp = DEFAULT_IP_ADDRESS; @Config(desc="Port that this server uses for the cluster.") private Integer clusterPort = DEFAULT_CLUSTER_PORT; @Config(desc="Ip address that this server uses for the cluster.") private String clusterIp = DEFAULT_IP_ADDRESS; @Config(desc = "Root directory.") private String rootDir = System.getProperty("root.dir"); @Config(desc = "Location of the conf directory relative to the root directory.") private String confDir = DEFAULT_CONF_DIR; @Config(desc = "Location of the lib directory relative to the root directory.") private String libDir = DEFAULT_LIB_DIR; @Config(desc = "Location of the bin directory relative to the root directory.") private String binDir = DEFAULT_BIN_DIR; @Config(desc = "Location of the html directory relative to the root directory.")
@Config(name = VALIDATION_SCHEMA_NAME, desc = "JSR303 validation assertion") @SuppressWarnings("unused") public static class JSR303Validation { private String id; @Config(desc = "Assert that JSR303 works as expected.") @FirstUpper @Size(min = 2, max = 50) private String prop; @Config(desc = "Assert that JSR303 works as expected.") @NotNull private Integer height; @Config(desc = "Assert that JSR303 works as expected.") @NotNull private Integer width;