Skip to content

Commit

Permalink
javadoc
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1246 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Jan 27, 2009
1 parent 8750579 commit d2b820f
Show file tree
Hide file tree
Showing 53 changed files with 827 additions and 100 deletions.
13 changes: 10 additions & 3 deletions webbeans-api/src/main/java/javax/annotation/Named.java
Expand Up @@ -27,7 +27,7 @@
import java.lang.annotation.Target;

/**
* Specifies the name of a Web Bean.
* Specifies the name of a bean.
*
* @author Gavin King
* @author Pete Muir
Expand All @@ -42,9 +42,16 @@
/**
* If no name is explicitly specified, the default name is used.
*
* @return the component name
* For simple beans and session beans the default name is the unqualified
* class name of the bean class, after converting the first character to
* lower case.
*
* For producer methods the default name is the method name, unless the
* method follows the JavaBeans property getter naming convention, in which
* case the default name is the JavaBeans property name.
*
* @return the bean name
*/

public String value() default "";

}
12 changes: 11 additions & 1 deletion webbeans-api/src/main/java/javax/annotation/Stereotype.java
Expand Up @@ -26,7 +26,7 @@
import java.lang.annotation.Target;

/**
* Specifies that an annotation type is a Web Beans stereotype.
* Specifies that an annotation type is a stereotype.
*
* @author Pete Muir
* @author Gavin King
Expand All @@ -38,8 +38,18 @@
public @interface Stereotype
{

/**
* Restrict the scope of the stereotyped bean
*
* @return the allowed scopes
*/
public Class<? extends Annotation>[] supportedScopes() default {};

/**
* Require that stereotype beans have certain API types
*
* @return the required types
*/
public Class<?>[] requiredTypes() default {};

}
Expand Up @@ -28,10 +28,9 @@
import java.lang.annotation.Target;

/**
* Specifies that a Web Bean is application scoped.
* Specifies that a bean is application scoped.
*
* @author Gavin King
*
* @author Pete Muir
*/

Expand Down
34 changes: 33 additions & 1 deletion webbeans-api/src/main/java/javax/context/Context.java
Expand Up @@ -20,7 +20,7 @@
import java.lang.annotation.Annotation;

/**
* The contract between the Web Bean manager and a Web Beans context object.
* The contract between the manager and a contextual object.
* This interface should not be called directly by the application.
*
* @author Gavin King
Expand All @@ -30,12 +30,44 @@
public interface Context
{

/**
* The scope which this context implements
*
* @return the scope
*/
public Class<? extends Annotation> getScopeType();

/**
* Return an existing instance of a contextual type or create a new instance
* of a contextual type
*
* @param <T> the type of contextual type
* @param contextual the contextual type
* @param creationalContext the creational context in which incompletely
* initialized may be placed
* @return the contextual instance, or null if no creational context is given
* and an instance does not exist in the context
* @throws ContextNotActiveException if the context is not active
*/
public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext);

/**
* Return an existing instance of a contextual type or create a new instance
* of a contextual type
*
* @param <T> the type of the contextual type
* @param contextual the contextual type
* @return the contextual instance, or null if an instance does not exist in
* the context
* @throws ContextNotActiveException if the context is not active
*/
public <T> T get(Contextual<T> contextual);

/**
* The context is only active at certain points in the application lifecycle
*
* @return true if the context is active
*/
boolean isActive();

}
Expand Up @@ -33,6 +33,8 @@
public class ContextNotActiveException extends ExecutionException
{

private static final long serialVersionUID = -3599813072560026919L;

public ContextNotActiveException()
{
super();
Expand Down
20 changes: 18 additions & 2 deletions webbeans-api/src/main/java/javax/context/Contextual.java
Expand Up @@ -17,15 +17,31 @@

package javax.context;

import javax.inject.CreationException;

/**
* The contract between a Context and an object that has its lifecycle managed
* by the context
* The contract between a context and a contextual type
* This interface should not be implemented directly by the application.
*
* @author Nicklas Karlsson
* @author Pete Muir
*/
public interface Contextual<T>
{
/**
* Create a new instance of the contextual type
*
* @param creationalContext the creational context in which incompletely
* initialized contexts may be placed
* @return the contextual instance
* @throws CreationException if a checked exception occurs whilst creating
* the instance
*/
public T create(CreationalContext<T> creationalContext);

/**
* Destroys an instance of the contexual type
* @param instance the insance to destroy
*/
public void destroy(T instance);
}
67 changes: 66 additions & 1 deletion webbeans-api/src/main/java/javax/context/Conversation.java
@@ -1,11 +1,76 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* 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 javax.context;

public interface Conversation {
/**
* Provides conversation management operations
*
* @author Pete Muir
*
*/
public interface Conversation
{

/**
* Mark a transient conversation long running. The container will generate an
* id
*/
public void begin();

/**
* Mark a transient conversation long running.
*
* @param id the id of the conversation
*/
public void begin(String id);

/**
* Mark a long running conversation transient
*/
public void end();

/**
* Determine if a conversation is long running or transient
*
* @return true if the conversation is long running
*/
public boolean isLongRunning();

/**
* Get the id associated with the current long running conversation
*
* @return the id of the current long running conversation
*/
public String getId();

/**
* Get the timeout for the current long running conversation.
*
* The conversation will destroy the conversation if it has not been accessed
* within this time period.
*
* @return the current timeout in milliseconds
*/
public long getTimeout();

/**
* Set the timeout for the current long running conversation
*
* @param milliseconds the new timeout in milliseconds
*/
public void setTimeout(long milliseconds);
}
Expand Up @@ -27,7 +27,7 @@
import java.lang.annotation.Target;

/**
* Specifies that a Web Bean is conversation scoped.
* Specifies that a bean is conversation scoped.
*
* @author Gavin King
* @author Pete Muir
Expand Down
2 changes: 1 addition & 1 deletion webbeans-api/src/main/java/javax/context/Dependent.java
Expand Up @@ -28,7 +28,7 @@
import java.lang.annotation.Target;

/**
* Specifies that a Web Bean is dependent scoped.
* Specifies that a bean is dependent scoped.
*
* @author Gavin King
* @author Pete Muir
Expand Down
Expand Up @@ -28,7 +28,7 @@
import java.lang.annotation.Target;

/**
* Specifies that a Web Bean is request scoped.
* Specifies that a bean is request scoped.
*
* @author Gavin King
* @author Pete Muir
Expand Down
4 changes: 2 additions & 2 deletions webbeans-api/src/main/java/javax/context/ScopeType.java
Expand Up @@ -25,7 +25,7 @@
import java.lang.annotation.Target;

/**
* Specifies that an annotation type is a Web Beans scope type.
* Specifies that an annotation type is a scope type.
*
* @author Gavin King
* @author Pete Muir
Expand All @@ -43,7 +43,7 @@
boolean normal() default true;

/**
* @return true if this is a passivating scope (Web Beans with this scope
* @return true if this is a passivating scope (beans with this scope
* type must be serializable)
*/
boolean passivating() default false;
Expand Down
Expand Up @@ -28,7 +28,7 @@
import java.lang.annotation.Target;

/**
* Specifies that a Web Bean is session scoped.
* Specifies that a bean is session scoped.
*
* @author Gavin King
* @author Pete Muir
Expand Down
1 change: 0 additions & 1 deletion webbeans-api/src/main/java/javax/decorator/Decorates.java
Expand Up @@ -30,7 +30,6 @@
* @author Gavin King
* @author Pete Muir
*/

@Target(FIELD)
@Retention(RUNTIME)
@Documented
Expand Down
3 changes: 1 addition & 2 deletions webbeans-api/src/main/java/javax/decorator/Decorator.java
Expand Up @@ -27,12 +27,11 @@
import javax.annotation.Stereotype;

/**
* Specifies that a class is a Web Beans decorator.
* Specifies that a class is a decorator.
*
* @author Gavin King
* @author Pete Muir
*/

@Target(TYPE)
@Retention(RUNTIME)
@Documented
Expand Down
Expand Up @@ -24,7 +24,7 @@
import java.lang.annotation.Target;

/**
* Specifies that an observer method is a transactional observer.
* Specifies that an observer method is an after transaction completion observer.
*
* @author Gavin King
*
Expand Down
Expand Up @@ -24,7 +24,7 @@
import java.lang.annotation.Target;

/**
* Specifies that an observer method is a transactional observer.
* Specifies that an observer method is an after transaction failure observer.
*
* @author Gavin King
*
Expand Down
Expand Up @@ -24,7 +24,7 @@
import java.lang.annotation.Target;

/**
* Specifies that an observer method is a transactional observer.
* Specifies that an observer method is an transaction failure observer.
*
* @author Gavin King
*
Expand Down
Expand Up @@ -24,7 +24,8 @@
import java.lang.annotation.Target;

/**
* Specifies that an observer method is a transactional observer.
* Specifies that an observer method is an after transaction completion
* observer.
*
* @author Gavin King
*
Expand Down
14 changes: 13 additions & 1 deletion webbeans-api/src/main/java/javax/event/Event.java
Expand Up @@ -27,14 +27,26 @@
* @author Pete Muir
*
* @param <T>
* the type of the event object
* the type of the event object
*/

public interface Event<T>
{

/**
* Fire an event
*
* @param event the event type
* @param bindings the event bindings
*/
public void fire(T event, Annotation... bindings);

/**
* Register an observer for a specific type
*
* @param observer the observer to register
* @param bindings the bindings to observe the event for
*/
public void observe(Observer<T> observer, Annotation... bindings);

}
2 changes: 1 addition & 1 deletion webbeans-api/src/main/java/javax/event/IfExists.java
Expand Up @@ -26,7 +26,7 @@

/**
* Specifies that an observer method is only called if the current instance of
* the Web Bean declaring the observer method already exists.
* the bean declaring the observer method already exists.
*
* @author Gavin King
* @author Pete Muir
Expand Down

0 comments on commit d2b820f

Please sign in to comment.