EA Resource Adapter

Identifier:
com.yakindu.bridges.ea.core.resourceAdapter

Since:
1.1.0

Description:
Resource adapters are added by the resource factory right after resource creation. They can be used to specify certain default load options which are also used even though the global preferences might differ.

Configuration Markup:

<!ELEMENT extension (resourceAdapter* | resourceFactory*)+>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT resourceAdapter EMPTY>

<!ATTLIST resourceAdapter

resource_adapter CDATA #IMPLIED>


<!ELEMENT resourceFactory EMPTY>

<!ATTLIST resourceFactory

resource_factory CDATA #IMPLIED>


Examples:

public class ReadOnlyEAResourceAdapter extends AdapterImpl {
 @Override
 public void notifyChanged(Notification notification) {
  if (notification.getEventType() == Notification.SET && notification.getNotifier() instanceof EAResource) {
   final EAResource resource = (EAResource) notification.getNotifier();

   // no further need for this adapter
   resource.eAdapters().remove(this);

   // always load models read-only
   resource.getDefaultLoadOptions().put(EAResource.OPTION_READONLY, Boolean.TRUE);
  }
 }
}