Demoting methods from an interface

If you promote a method to an interface, you can easily demote the method.

About this task

Note: The import statement added to the interface class when you promoted the method is not removed from the interface class when you demote the method because we cannot guarantee that it is not being used by other methods. A warning message of "Import is never used" appears in the Problems view if this warning level is turned on in the Preferences.

Procedure

  1. Open the Java™ editor in one of the following ways:
    • In the Project Explorer view of the Java EE perspective, select the Java file for the bean class that contains the method to be promoted. Select Open with > Java Editor.
  2. In the Outline view, right-click the business method that you want to demote, and select the appropriate option, depending on the interface that you are demoting it from:
    • Enterprise Bean (1.x-2.x) > Demote from Local Interface
    • Enterprise Bean (1.x-2.x) > Demote from Local Home Interface
    • Enterprise Bean (1.x-2.x) > Demote from Remote Interface
    • Enterprise Bean (1.x-2.x) > Demote from Home Interface
    • Enterprise Bean (1.x-2.x) > Demote from Service Endpoint Interface
  3. Save your changes and close the Java editor.

Results

The demoted method is removed from the interface. The import statement that was added during promote is not removed.

Feedback