[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: ISSUE 96: Proposal - "Are annotations allowed on static methods?"
ISSUE: Are annotations allowed on static methods? PROPOSAL: SCA annotations are not allowed on static methods and static fields. Add the following text at the end of line 872 ( sca-javacaa-1.1-spec-cd01, section 8). As a general rule, SCA annotations are not allowed on static methods and static fields. It is an error to use an SCA annotation on a static method or a static field of an implementation class and the SCA runtime MUST NOT instantiate such implementation class. RATIONALE: The following are the SCA annotations that could be applied on static fields and methods. The text next to each annotation explains a reason for disallowing the annotation. @AllowsPassByReference - On service method of remotable service. Does not make sense since remotable service methods can not be static. @Callback - The callback is per implementation instance and since static methods can only access static methods and fields @ComponentName - Will be a problem since we don't restrict that an implementation can be used at most once in an assembly. @Context - Will be a problem since we don't restrict that an implementation can be used at most once in an assembly. @ConversationID - Will be a problem since we don't restrict that an implementation can be used at most once in an assembly. @Destroy - Since this is invoked for each implementation instance going out of scope and since static methods can only access static methods and fields. @EndsConversation - Not applicable since it is applied only on interface methods. @Init - Since this is invoked for each implementation instance coming into scope and since static methods can only access static methods and fields. @OneWay - Applied on service method and service method cannot be static. @Property - Will be a problem since we don't restrict that an implementation can be used at most once in an assembly. @Reference - Will be a problem since we don't restrict that an implementation can be used at most once in an assembly.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]