weblogic10的EJB3.0实现仅在类层次上支持泛型

weblogic10的EJB3.0实现仅在类层次上支持泛型
见下面的文档描述:
The EJB 3.0 programming model supports the use of generics in the business interface at the class level.

BEA recommends as a best practice that you first define a super-interface that uses the generics, and then have the actual business interface extend this super-interface with a specific data type.

The following example shows how to do this. First program the super-interface that uses generics:

  public interface RootI<T> {
    public T getObject();
public void updateObject(T object);
}

Then program the actual business interface to extend Root*<T> for a particular data type:

  @Remote
public interface StatelessI extends RootI<String> { }

Finally, program the actual stateless session bean to implement the business interface; use the specified data type, in this case String, in the implementation of the methods:

  @Stateless
public class StatelessSample implements StatelessI {
public String getObject() {
return null;
}
public void updateObject(String object) {
}
}

你可能感兴趣的:(weblogic10的EJB3.0实现仅在类层次上支持泛型)