http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/entity/Identity.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/entity/Identity.java b/core/api/src/main/java/org/qi4j/api/entity/Identity.java deleted file mode 100644 index b4adbc5..0000000 --- a/core/api/src/main/java/org/qi4j/api/entity/Identity.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.entity; - -import org.qi4j.api.injection.scope.State; -import org.qi4j.api.mixin.Mixins; -import org.qi4j.api.property.Immutable; -import org.qi4j.api.property.Property; - -/** - * This interface provides the identity of the object which may be used - * to store the state in a database. It is not the responsibility of the - * framework to come up with a good identity string. - */ -@Mixins( Identity.IdentityMixin.class ) -public interface Identity -{ - /** - * Returns the client view of the identity. - * <p> - * It is unique within the owning repository, but potentially not unique globally and between - * types. - * </p> - * @return The Identity of 'this' composite. - */ - @Immutable - Property<String> identity(); - - /** - * Default Identity implementation. - */ - class IdentityMixin - implements Identity - { - @State - private Property<String> identity; - - @Override - public Property<String> identity() - { - return identity; - } - } -}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/entity/IdentityGenerator.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/entity/IdentityGenerator.java b/core/api/src/main/java/org/qi4j/api/entity/IdentityGenerator.java deleted file mode 100644 index 8d076e5..0000000 --- a/core/api/src/main/java/org/qi4j/api/entity/IdentityGenerator.java +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2007 Niclas Hedhman. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. - * - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.qi4j.api.entity; - -/** - * Generator for identities of EntityComposite's. - */ -public interface IdentityGenerator -{ - /** - * Generate a new id for the given Composite type - * - * @param compositeType the type of composite - * - * @return a new identity - */ - String generate( Class<?> compositeType ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java b/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java deleted file mode 100644 index 3eabd78..0000000 --- a/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.entity; - -/** - * Lifecycle interface for all Composites. - * <p> - * This Lifecycle interface is a built-in feature of the Zest runtime, similar to the Initializable interface. - * Any Mixin that implements this interface AND is part of an EntityComposite will have these two methods called - * upon creation/removal of the EntityComposite instance to/from the EntityStore. Meaning, the create method is called - * only when the identifiable EntityComposite is created the first time, and not when it is read from its persisted - * state and created into memory. - * </p> - * <p> - * Example; - * </p> - * <pre><code> - * public interface System - * { - * Property<User> admin(); - * } - * - * public class SystemAdminMixin<LifeCycle> - * implements System, Lifecyle, ... - * { - * @Structure private UnitOfWork uow; - * @This private Identity meAsIdentity; - * - * public void create() - * { - * String thisId = meAsIdentity.identity().get(); - * EntityBuilder builder = uow.newEntityBuilder( thisId + ":1", UserComposite.class ); - * User admin = builder.newInstance(); - * admin.set( admin ); - * } - * - * public void remove() - * { - * uow.remove( admin.get() ); - * } - * } - * - * @Mixins( SystemAdminMixin.class ) - * public interface SystemEntity extends System, EntityComposite - * {} - * - * </code></pre> - */ -public interface Lifecycle -{ - - /** - * Creation callback method. - * <p> - * Called by the Zest runtime before the newInstance of the entity completes, before the constraints are checked, - * allowing for additional initialization. - * </p> - * @throws LifecycleException if the entity could not be created - */ - void create() - throws LifecycleException; - - /** - * Removal callback method. - * <p> - * Called by the Zest runtime before the entity is removed from the system, allowing - * for clean-up operations. - * </p> - * @throws LifecycleException if the entity could not be removed - */ - void remove() - throws LifecycleException; -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/entity/LifecycleException.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/entity/LifecycleException.java b/core/api/src/main/java/org/qi4j/api/entity/LifecycleException.java deleted file mode 100644 index b358fa1..0000000 --- a/core/api/src/main/java/org/qi4j/api/entity/LifecycleException.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2008, Rickard Ãberg. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.entity; - -/** - * Thrown by methods of Lifecycle if invocation fails - */ -public class LifecycleException - extends RuntimeException -{ - public LifecycleException( String s ) - { - super( s ); - } - - public LifecycleException( String s, Throwable throwable ) - { - super( s, throwable ); - } - - public LifecycleException( Throwable throwable ) - { - super( throwable ); - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/entity/Queryable.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/entity/Queryable.java b/core/api/src/main/java/org/qi4j/api/entity/Queryable.java deleted file mode 100644 index 768e17d..0000000 --- a/core/api/src/main/java/org/qi4j/api/entity/Queryable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2008, Alin Dreghiciu. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.entity; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * This annotation is used to mark entity types or properties/associations that are indexable. - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.TYPE, ElementType.METHOD } ) -@Documented -public @interface Queryable -{ - boolean value() default true; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/entity/package.html ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/entity/package.html b/core/api/src/main/java/org/qi4j/api/entity/package.html deleted file mode 100644 index 0386d8c..0000000 --- a/core/api/src/main/java/org/qi4j/api/entity/package.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<html> - <body> - <h2>Entity API.</h2> - </body> -</html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/event/package.html ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/event/package.html b/core/api/src/main/java/org/qi4j/api/event/package.html deleted file mode 100644 index a5ed0a7..0000000 --- a/core/api/src/main/java/org/qi4j/api/event/package.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<html> - <body> - <h2>Event API.</h2> - </body> -</html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/InjectionScope.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/InjectionScope.java b/core/api/src/main/java/org/qi4j/api/injection/InjectionScope.java deleted file mode 100644 index 7ada2e6..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/InjectionScope.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.injection; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * This is used to annotate annotation types which are used for injection. - * Each scope signifies a particular scope from which the injection value should be taken. - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.ANNOTATION_TYPE } ) -@Documented -public @interface InjectionScope -{ -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/package.html ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/package.html b/core/api/src/main/java/org/qi4j/api/injection/package.html deleted file mode 100644 index c41b495..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/package.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<html> - <body> - <h2>Dependency Injection API.</h2> - </body> -</html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java b/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java deleted file mode 100644 index 230e5c9..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.injection.scope; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.qi4j.api.injection.InjectionScope; - -/** - * Annotation to denote the injection of a - * invocation specific resource. - * These include: - * <pre><code> - * - The Method being invoked. - * - * - An AnnotationElement with annotations - * from both mixin type, mixin - * implementation. - * - * - An Annotation of a specific type - * </code></pre> - * Examples: - * <pre><code> - * @Invocation Method theInvokedMethod - * @Invocation AnnotationElement annotations - * @Invocation Matches matchesAnnotation - * </code></pre> - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.FIELD, ElementType.PARAMETER } ) -@Documented -@InjectionScope -public @interface Invocation -{ -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java b/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java deleted file mode 100644 index 6116cc1..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.injection.scope; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.qi4j.api.injection.InjectionScope; - -/** - * Annotation to denote the injection of a service dependency into a Fragment. - * <p> - * Examples: - * </p> - * <pre><code> - * @Service MyService service - * @Service Iterable<MyService> services - * @Service ServiceReference<MyService> serviceRef - * @Service Iterable<ServiceReference<MyService>> serviceRefs - * </code></pre> - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.FIELD, ElementType.PARAMETER } ) -@Documented -@InjectionScope -public @interface Service -{ -} - http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/scope/State.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/State.java b/core/api/src/main/java/org/qi4j/api/injection/scope/State.java deleted file mode 100644 index ec3c52a..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/scope/State.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.injection.scope; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.qi4j.api.injection.InjectionScope; - -/** - * Annotation to denote the injection of a property, association or - * StateHolder. - * <pre><code> - * @State Property<StringState propertyName; - * @State Association<MyEntityState associationName; - * @State ManyAssociation<MyEntityState manyAssociationName; - * @State NamedAssociation<MyEntityState namedAssociationName; - * @State StateHolder state; - * @State AssociationStateHolder associationState; - * </code></pre> - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.FIELD, ElementType.PARAMETER } ) -@Documented -@InjectionScope -public @interface State -{ - /** - * Name of the property or association. - * If not set then name will be name of field. - * - * @return the name - */ - public abstract String value() default ""; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java b/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java deleted file mode 100644 index 252af5e..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.injection.scope; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.qi4j.api.injection.InjectionScope; - -/** - * Annotation to denote the injection of a - * resource specific for the module which the - * injected object/fragment is instantiated in. - * <p> - * Valid types are: - * </p> - * <pre><code> - * - TransientBuilderFactory - * - ObjectBuilderFactory - * - UnitOfWorkFactory - * - ServiceFinder - * - Module - * - Layer - * - Application - * - Qi4j - * - Qi4jSPI - * </code></pre> - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.FIELD, ElementType.PARAMETER } ) -@Documented -@InjectionScope -public @interface Structure -{ -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/scope/This.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/This.java b/core/api/src/main/java/org/qi4j/api/injection/scope/This.java deleted file mode 100644 index 4d806d0..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/scope/This.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.injection.scope; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.qi4j.api.injection.InjectionScope; - -/** - * Annotation to denote the injection of a reference to the same Composite - * as the fragment is a part of. - * <p> - * If the Composite type does not implement the type of the field or parameter - * then it will be referencing a private mixin. - * </p> - * <p> - * Calls to the reference will have the same semantics as calls to the Composite itself. - * Specifically the same set of Modifiers will be used. - * </p> - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.FIELD, ElementType.PARAMETER } ) -@Documented -@InjectionScope -public @interface This -{ -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/scope/Uses.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/Uses.java b/core/api/src/main/java/org/qi4j/api/injection/scope/Uses.java deleted file mode 100644 index d5b4080..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/scope/Uses.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.injection.scope; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.qi4j.api.injection.InjectionScope; - -/** - * Annotation to denote the injection of a dependency to be used by a Mixin. The injected - * object is provided either by the TransientBuilder.uses() declarations, or if an instance of the appropriate types is not - * found, then a new Transient or Object is instantiated. - * Call {@link org.qi4j.api.composite.TransientBuilder#use} to provide the instance - * to be injected. - * - * Example: - * <pre>@Uses SomeType someInstance</pre> - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.PARAMETER, ElementType.FIELD } ) -@Documented -@InjectionScope -public @interface Uses -{ -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/injection/scope/package.html ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/package.html b/core/api/src/main/java/org/qi4j/api/injection/scope/package.html deleted file mode 100644 index b0ec496..0000000 --- a/core/api/src/main/java/org/qi4j/api/injection/scope/package.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<html> - <body> - <h2>Dependency Injection Scopes.</h2> - </body> -</html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/Metric.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/Metric.java b/core/api/src/main/java/org/qi4j/api/metrics/Metric.java deleted file mode 100644 index 775ab5d..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/Metric.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Marker interface for all Metric types. - */ -public interface Metric -{ -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounter.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounter.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounter.java deleted file mode 100644 index 67404b3..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounter.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Metrics Counter. - */ -public interface MetricsCounter extends Metric -{ - void increment(); - - void increment( int steps ); - - void decrement(); - - void decrement( int steps ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java deleted file mode 100644 index caa2915..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Create MetricsCounter instances. - */ -public interface MetricsCounterFactory extends MetricsFactory -{ - /** - * Create a MetricsCounter instance. - * If the same arguments are given twice, the same instance must be returned. - * - * @param origin The class that instantiate the metric - * @param name A human readable, short name of the metric. - * - * @return A Metric instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported. - */ - MetricsCounter createCounter( Class<?> origin, String name ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsFactory.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsFactory.java deleted file mode 100644 index 0813dde..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsFactory.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Metrics Factory. - */ -public interface MetricsFactory -{ - Iterable<Metric> registered(); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsGauge.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsGauge.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsGauge.java deleted file mode 100644 index 1dd293b..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsGauge.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * MetricsGauge is the most basic Metric type, and is completely flexible and therefor handled slightly differently in - * the MetricsFactory than all other Gauges. It needs to pass on custom code, so the implementation is typically - * an anonymous class, inlined at the implementation. - * - * @param <T> Any type holding the MetricsGauge's current value. - */ -public interface MetricsGauge<T> extends Metric -{ - /** - * Returns the metric's current value. - * - * @return the metric's current value - */ - T value(); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsGaugeFactory.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsGaugeFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsGaugeFactory.java deleted file mode 100644 index a469ac2..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsGaugeFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Register MetricsGauge with the underlying Metrics system. - */ -public interface MetricsGaugeFactory extends MetricsFactory -{ - /** - * Register a MetricsGauge with the underlying Metrics system. - * - * @param origin The class where the MetricsGauge is created. - * @param name A human readable, short name of the metric. - * @param gauge The implementation of the MetricsGauge. - * @param <T> Any type holding the MetricsGauge's current value. - * - * @return The same MetricsGauge or the DefaultMetric.NULL MetricsGauge instance. - */ - <T> MetricsGauge<T> registerGauge( Class<?> origin, String name, MetricsGauge<T> gauge ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheck.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheck.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheck.java deleted file mode 100644 index 18bb151..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheck.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Metrics Health Check. - */ -public interface MetricsHealthCheck extends Metric -{ - Result check() - throws Exception; - - public final class Result - { - private final boolean healthy; - private final String message; - private final Throwable exception; - - public Result( boolean isHealthy, String message, Throwable exception ) - { - healthy = isHealthy; - this.message = message; - this.exception = exception; - } - - public boolean isHealthy() - { - return healthy; - } - - public String getMessage() - { - return message; - } - - public Throwable getException() - { - return exception; - } - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java deleted file mode 100644 index 12decc5..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Create MetricsHealthCheck instances. - */ -public interface MetricsHealthCheckFactory extends MetricsFactory -{ - /** - * Create a MetricsHealthCheck instance. - * If the same arguments are given twice, the same instance must be returned. - * - * @param origin The class that instantiate the metric - * @param name A human readable, short name of the metric. - * @param check The health check to be performed regularly. - * - * @return A MetricsHealthCheck instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported. - * - */ - MetricsHealthCheck registerHealthCheck( Class<?> origin, String name, MetricsHealthCheck check ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogram.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogram.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogram.java deleted file mode 100644 index fe38869..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogram.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * A metric which calculates the distribution of a value. - * - * @see <a href="http://www.johndcook.com/standard_deviation.html">Accurately computing running - * variance</a> - */ -public interface MetricsHistogram extends Metric -{ - void update( long newValue ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java deleted file mode 100644 index ab62508..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Create MetricsHistogram instances. - */ -public interface MetricsHistogramFactory extends MetricsFactory -{ - /** - * Create a MetricsHistogram instance. - * If the same arguments are given twice, the same instance must be returned. - * - * @param origin The class that instantiate the metric - * @param name A human readable, short name of the metric. - * - * @return A Metric instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported. - * - */ - MetricsHistogram createHistogram( Class<?> origin, String name ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsMeter.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsMeter.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsMeter.java deleted file mode 100644 index acbb73d..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsMeter.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * A meter metric which measures mean throughput and one-, five-, and fifteen-minute - * exponentially-weighted moving average throughputs. - * - * @see <a href="http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average">EMA</a> - */ -public interface MetricsMeter extends Metric -{ - void mark(); - - /** - * Mark the occurrence of a given number of events. - * - * @param numberOfEvents the number of events - */ - void mark( int numberOfEvents ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsMeterFactory.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsMeterFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsMeterFactory.java deleted file mode 100644 index 53928bd..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsMeterFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -import java.util.concurrent.TimeUnit; - -/** - * Create MetricsMeter instances. - */ -public interface MetricsMeterFactory extends MetricsFactory -{ - /** - * Create a MetricsMeter instance. - * If the same arguments are given twice, the same instance must be returned. - * - * @param origin The class that instantiate the metric - * @param name A human readable, short name of the metric. - * @param eventType the plural name of the event the meter is measuring (e.g., {@code "requests"}) - * @param rate the scale unit for this timer's rate metrics - * - * @return A Metric instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported. - */ - MetricsMeter createMeter( Class<?> origin, String name, String eventType, TimeUnit rate ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsNotSupportedException.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsNotSupportedException.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsNotSupportedException.java deleted file mode 100644 index aec7859..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsNotSupportedException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.qi4j.api.metrics; - -/** - * Thrown when the underlying MetricsProvider do not support a Metric type. - */ -public class MetricsNotSupportedException extends RuntimeException -{ - public MetricsNotSupportedException( Class<? extends MetricsFactory> factoryType, - Class<? extends MetricsProvider> providerType - ) - { - super( "Metrics [" + factoryType.getName() + "] is not supported by MetricsProvider [" + providerType.getName() + "]." ); - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java deleted file mode 100644 index c11996b..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Metrics Provider SPI. - * <p> - * The Zest Runtime will automatically ook for a service that implements the MetricsProvider interdace - * and use it for internal Runtime metrics, such as the UnitOfWork measuring the time from creation to close. - * </p> - * <p> - * The Metrics Library is available to add metric functionality to applications in the same way, and - * will use the same MetricsProvider. - * </p> - * <p> - * Note that the usual visibitlity rules applies, so you might have more than one MetricsProvider server, - * perhaps per layer. - * </p> - */ -public interface MetricsProvider -{ - /** - * Creates a new factory instance. - * - * The instanctiation is done by providing a Metric type, which is one of - * <ul> - * <li>{@link MetricsCounter}</li> - * <li>{@link MetricsGauge}</li> - * <li>{@link MetricsHealthCheck}</li> - * <li>{@link MetricsHistogram}</li> - * <li>{@link MetricsMeter}</li> - * <li>{@link MetricsTimer}</li> - * </ul> - * - * @param factoryType The class of the metric type needed. - * @param <T> The metric type requested. - * - * @return A factory instance - * - * @throws MetricsNotSupportedException when the MetricsProvider is not supporting the factory type requested. - */ - <T extends MetricsFactory> T createFactory( Class<T> factoryType ) - throws MetricsNotSupportedException; -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimer.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimer.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimer.java deleted file mode 100644 index 6de4714..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimer.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -/** - * Timer Metrics. - */ -public interface MetricsTimer extends Metric -{ - /** - * Start the Timer Metrics. - */ - Context start(); - - /** - * Timer Metrics Context. - */ - public interface Context - { - /** - * Stop the Timer Metrics. - */ - void stop(); - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java deleted file mode 100644 index 18d3e38..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.metrics; - -import java.util.concurrent.TimeUnit; - -/** - * Create MetricsTimer instances. - */ -public interface MetricsTimerFactory extends MetricsFactory -{ - /** - * Create a MetricsTimer instance. - * If the same arguments are given twice, the same instance must be returned. - * - * @param origin The class that instantiate the metric - * @param name A human readable, short name of the metric. - * @param duration the scale unit for this timer's duration metrics - * @param rate the scale unit for this timer's rate metrics - * - * @return A Metric instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported. - * - */ - MetricsTimer createTimer( Class<?> origin, String name, TimeUnit duration, TimeUnit rate ); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/metrics/package.html ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/package.html b/core/api/src/main/java/org/qi4j/api/metrics/package.html deleted file mode 100644 index d0280bd..0000000 --- a/core/api/src/main/java/org/qi4j/api/metrics/package.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<html> - <body> - <h2>Metrics API.</h2> - </body> -</html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/mixin/Initializable.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/mixin/Initializable.java b/core/api/src/main/java/org/qi4j/api/mixin/Initializable.java deleted file mode 100644 index 53314e9..0000000 --- a/core/api/src/main/java/org/qi4j/api/mixin/Initializable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2008, Rickard Ãberg. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.mixin; - -/** - * Fragments which want to be initialized can implement - * this callback interface. It will be invoked after - * the fragment has bee instantiated and all injections have been done. - */ -public interface Initializable -{ - /** - * Initialize the fragment - * - * @throws org.qi4j.api.mixin.InitializationException - * if something went wrong - */ - void initialize() - throws InitializationException; -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/mixin/InitializationException.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/mixin/InitializationException.java b/core/api/src/main/java/org/qi4j/api/mixin/InitializationException.java deleted file mode 100644 index 4a42da6..0000000 --- a/core/api/src/main/java/org/qi4j/api/mixin/InitializationException.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.mixin; - -/** - * Thrown when a Fragment or object could not be instantiated. - */ -public class InitializationException - extends RuntimeException -{ - private static final long serialVersionUID = 1L; - - public InitializationException() - { - } - - public InitializationException( String message ) - { - super( message ); - } - - public InitializationException( String message, Throwable cause ) - { - super( message, cause ); - } - - public InitializationException( Throwable cause ) - { - super( cause ); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/mixin/InvalidMixinException.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/mixin/InvalidMixinException.java b/core/api/src/main/java/org/qi4j/api/mixin/InvalidMixinException.java deleted file mode 100644 index 967c6b6..0000000 --- a/core/api/src/main/java/org/qi4j/api/mixin/InvalidMixinException.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2009 Niclas Hedhman. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. - * - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.qi4j.api.mixin; - -import java.lang.reflect.Method; - -/** - * This exception is thrown if a Mixin is invalid (missing method implementation). - */ -public class InvalidMixinException - extends RuntimeException -{ - public InvalidMixinException( Class mixinClass, Method method ) - { - super( mixinClass.getName() + "does not have a method implementation for " + method ); - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/mixin/MixinDescriptor.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/mixin/MixinDescriptor.java b/core/api/src/main/java/org/qi4j/api/mixin/MixinDescriptor.java deleted file mode 100644 index 288aac3..0000000 --- a/core/api/src/main/java/org/qi4j/api/mixin/MixinDescriptor.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2008, Rickard Ãberg. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.mixin; - -/** - * Mixin Descriptor. - */ -public interface MixinDescriptor -{ - Class<?> mixinClass(); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/mixin/MixinMappingException.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/mixin/MixinMappingException.java b/core/api/src/main/java/org/qi4j/api/mixin/MixinMappingException.java deleted file mode 100644 index 4bd3a8a..0000000 --- a/core/api/src/main/java/org/qi4j/api/mixin/MixinMappingException.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2008 Niclas Hedhman. All rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. - * - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.qi4j.api.mixin; - -/** - * This Exception is thrown when it is not possible to map the MixinType to a valid - * CompositeType. - */ -public class MixinMappingException - extends RuntimeException -{ - private static final long serialVersionUID = 6843167709252705294L; - - public MixinMappingException( String message ) - { - super( message ); - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java b/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java deleted file mode 100644 index e308381..0000000 --- a/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.mixin; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * This annotation is used in composites to declare mixin implementation classes. - * <p> - * Mixins tells the runtime which implementation class of a Mixin should be - * used. The @Mixins annotation can occur at any level in the composite hierarchy - * and the runtime will match each found Mixin implementation against a Mixins annotation. - * All mixin interfaces must have a Mixin implementation in the composite hierarchy or - * a runtime exception will occur. - * </p> - * <p> - * Example; - * </p> - * <pre><code> - * - * @Mixins( MyBeerOrder.class ) - * public interface BeerOrderComposite extends BeerOrder, Composite - * { - * } - * - * public class MyBeerOrder - * implements BeerOrder - * { - * : - * } - * </code></pre> - * <p> - * Many implementations can be listed, - * </p> - * <pre><code> - * @Mixins( { MyBeerOrder.class, DescriptionImpl.class } ) - * public interface BeerOrderComposite extends BeerOrder, Description, Composite - * { - * } - * </code></pre> - * <p> - * If the Mixins is a class that implements InvocationHandler, it will be - * used for all mixins. To avoid that an invocation handler based implementation - * not service all mixin, use the AppliesTo annotation. - * </p> - * - * <p> - * It is valid to have multiple Mixins for a mixin. The first one found - * will be used. The search order is in the order they are written in the Mixins - * annotation left-to-right, and depth-first recursive search of the super-interfaces again - * left-to-right. - * </p> - * - * @see org.qi4j.api.common.AppliesTo - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( ElementType.TYPE ) -@Documented -public @interface Mixins -{ - Class<?>[] value(); -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/mixin/NoopMixin.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/mixin/NoopMixin.java b/core/api/src/main/java/org/qi4j/api/mixin/NoopMixin.java deleted file mode 100644 index 948018e..0000000 --- a/core/api/src/main/java/org/qi4j/api/mixin/NoopMixin.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2008, Rickard Ãberg. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.mixin; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; - -/** - * Generic mixin that is a no-op. Can be useful if the functionality - * of a method is mainly provided by concerns and side-effects. - */ -public final class NoopMixin - implements InvocationHandler -{ - private static final Boolean BOOLEAN_DEFAULT = Boolean.FALSE; - private static final Short SHORT_DEFAULT = 0; - private static final Character CHARACTER_DEFAULT = 0; - private static final Integer INTEGER_DEFAULT = 0; - private static final Long LONG_DEFAULT = 0L; - private static final Float FLOAT_DEFAULT = 0f; - private static final Double DOUBLE_DEFAULT = 0.0; - - @Override - public Object invoke( Object object, Method method, Object[] args ) - throws Throwable - { - Class<?> retType = method.getReturnType(); - if( !retType.isPrimitive() ) - { - return null; - } - if( Void.TYPE == retType ) - { - return null; - } - if( Boolean.TYPE == retType ) - { - return BOOLEAN_DEFAULT; - } - if( Short.TYPE == retType ) - { - return SHORT_DEFAULT; - } - if( Character.TYPE == retType ) - { - return CHARACTER_DEFAULT; - } - if( Integer.TYPE == retType ) - { - return INTEGER_DEFAULT; - } - if( Long.TYPE == retType ) - { - return LONG_DEFAULT; - } - if( Float.TYPE == retType ) - { - return FLOAT_DEFAULT; - } - if( Double.TYPE == retType ) - { - return DOUBLE_DEFAULT; - } - return null; - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/mixin/package.html ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/mixin/package.html b/core/api/src/main/java/org/qi4j/api/mixin/package.html deleted file mode 100644 index a0ebe07..0000000 --- a/core/api/src/main/java/org/qi4j/api/mixin/package.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<html> - <body> - <h2>Mixin API.</h2> - </body> -</html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java b/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java deleted file mode 100644 index 71a4cb7..0000000 --- a/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2008, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.object; - -import org.qi4j.api.common.InvalidApplicationException; - -/** - * This exception is thrown if no visible Object of the requested type can be found. - */ -public class NoSuchObjectException - extends InvalidApplicationException -{ - private static final long serialVersionUID = -1121690536365682511L; - - private final String objectType; - private final String moduleName; - - public NoSuchObjectException( String type, String moduleName ) - { - super( "Could not find any visible Object of type [" + type + "] in module [" + - moduleName + "]." ); - this.objectType = type; - this.moduleName = moduleName; - } - - public String objectType() - { - return objectType; - } - - public String moduleName() - { - return moduleName; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/object/ObjectDescriptor.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/object/ObjectDescriptor.java b/core/api/src/main/java/org/qi4j/api/object/ObjectDescriptor.java deleted file mode 100644 index 115c52e..0000000 --- a/core/api/src/main/java/org/qi4j/api/object/ObjectDescriptor.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.object; - -import org.qi4j.api.composite.ModelDescriptor; - -/** - * Object Descriptor. - */ -public interface ObjectDescriptor - extends ModelDescriptor -{ -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java b/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java deleted file mode 100644 index 9b8ec47..0000000 --- a/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2007, Rickard Ãberg. All Rights Reserved. - * Copyright (c) 2007, Niclas Hedhman. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.qi4j.api.object; - -import org.qi4j.api.common.ConstructionException; - -/** - * This factory creates and injects POJO's. - */ -public interface ObjectFactory -{ - /** - * Create new objects of the given type. - * - * @param type an object class which will be instantiated. - * - * @return new objects. - * - * @throws ConstructionException Thrown if instantiation fails. - * @throws NoSuchObjectException Thrown if {@code type} class is not an object. - */ - <T> T newObject( Class<T> type, Object... uses ) - throws NoSuchObjectException, ConstructionException; - - /** - * Inject an existing instance. Only fields and methods will be called. - * - * @param instance - * - * @throws ConstructionException - */ - void injectTo( Object instance, Object... uses ) - throws ConstructionException; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/object/package.html ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/object/package.html b/core/api/src/main/java/org/qi4j/api/object/package.html deleted file mode 100644 index 1e06504..0000000 --- a/core/api/src/main/java/org/qi4j/api/object/package.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<html> - <body> - <h2>Object API.</h2> - </body> -</html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/package.html ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/package.html b/core/api/src/main/java/org/qi4j/api/package.html deleted file mode 100644 index ff7d9af..0000000 --- a/core/api/src/main/java/org/qi4j/api/package.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<html> - <body> - <h2>Apache Zest⢠API.</h2> - </body> -</html> http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/property/DefaultValues.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/property/DefaultValues.java b/core/api/src/main/java/org/qi4j/api/property/DefaultValues.java deleted file mode 100644 index 3d0dbff..0000000 --- a/core/api/src/main/java/org/qi4j/api/property/DefaultValues.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2008, Michael Hunger. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.property; - -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - -/** - * Default values for various property types - */ -public final class DefaultValues -{ - private static final Map<Type, Object> DEFAULT_VALUES = new HashMap<Type, Object>(); - - static - { - DEFAULT_VALUES.put( Byte.class, 0 ); - DEFAULT_VALUES.put( Short.class, 0 ); - DEFAULT_VALUES.put( Character.class, 0 ); - DEFAULT_VALUES.put( Integer.class, 0 ); - DEFAULT_VALUES.put( Long.class, 0L ); - DEFAULT_VALUES.put( Double.class, 0D ); - DEFAULT_VALUES.put( Float.class, 0F ); - DEFAULT_VALUES.put( Boolean.class, false ); - DEFAULT_VALUES.put( String.class, "" ); - } - - public static Object getDefaultValueOf( Type type ) - { - Object value = DEFAULT_VALUES.get( type ); - if( value != null ) - { - return value; - } - if( type instanceof ParameterizedType ) - { - // List<Foo> -> List - type = ( (ParameterizedType) type ).getRawType(); - } - - if( type instanceof Class ) - { - Class typeAsClass = (Class) type; - if( Set.class.isAssignableFrom( typeAsClass ) ) - { - return new HashSet(); - } - else if( Map.class.isAssignableFrom( typeAsClass ) ) - { - return new LinkedHashMap(); - } - else if( Collection.class.isAssignableFrom( typeAsClass ) ) - { - return new ArrayList(); - } - else if( typeAsClass.isEnum() ) - { - return ( (Class) type ).getEnumConstants()[ 0 ]; - } - } - throw new IllegalArgumentException( "Cannot use @UseDefaults with type " + type.toString() ); - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java b/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java deleted file mode 100644 index b8b9467..0000000 --- a/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2007,2008 Niclas Hedhman. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. - * - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.qi4j.api.property; - -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -import static org.qi4j.api.util.Classes.typeOf; - -/** - * Generic Property info utility class. - */ -public final class GenericPropertyInfo -{ - public static Type propertyTypeOf( AccessibleObject accessor ) - { - return toPropertyType( typeOf( accessor ) ); - } - - public static Type toPropertyType( Type methodReturnType ) - { - if( methodReturnType instanceof ParameterizedType ) - { - ParameterizedType parameterizedType = (ParameterizedType) methodReturnType; - if( Property.class.isAssignableFrom( (Class<?>) parameterizedType.getRawType() ) ) - { - return parameterizedType.getActualTypeArguments()[ 0 ]; - } - } - - if( methodReturnType instanceof Class<?> ) - { - Type[] interfaces = ( (Class<?>) methodReturnType ).getGenericInterfaces(); - for( Type anInterface : interfaces ) - { - Type propertyType = toPropertyType( anInterface ); - if( propertyType != null ) - { - return propertyType; - } - } - } - return null; - } -} http://git-wip-us.apache.org/repos/asf/zest-java/blob/061ddaa0/core/api/src/main/java/org/qi4j/api/property/Immutable.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/property/Immutable.java b/core/api/src/main/java/org/qi4j/api/property/Immutable.java deleted file mode 100644 index 39e3cf9..0000000 --- a/core/api/src/main/java/org/qi4j/api/property/Immutable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2008, Rickard Ãberg. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.qi4j.api.property; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * This annotation adds Immutability to Types, Properties and Associations - */ -@Retention( RetentionPolicy.RUNTIME ) -@Target( { ElementType.TYPE, ElementType.METHOD } ) -@Documented -public @interface Immutable -{ -}
