| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html> |
| <head> |
| <title>OSBP DSL Matadata Service Bundle Overview</title> |
| </head> |
| <body> |
| <div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204); border-image: none;"><strong>DSL Metadata Service</strong></div> |
| |
| <p>The DSL Metadata Service provides DSL metadata to the centralized MetadataBuilderService as a participant of the service via the interface <em>IMetadataBuilderService</em>. To achive this, it extends the abstract class AbstractBuilderParticipant. During startup DSL Metadata Service examines every bundle presented by the OSGi extender pattern and looks for a key in the bundle's manifest file <strong><em>"Factory-Model"</em></strong> and takes the presented value as extension for this model instance. The value must match the DSL extension of the related grammar.</p> |
| |
| <p>Example MANIFEST.MF:</p> |
| |
| <p>Factory-Model: perspective</p> |
| |
| <hr /> |
| <p>DSL Metadata Service provides a service via the interface <em>IDSLMetadataService</em> which can be tracked by ServiceTrackers to consume this service. The service presents any EClass from the analyzed model instances and furthermore can return their translators. If a bundleclass path must be constructed, it also returns the bundel in which the model instance was found.</p> |
| |
| <p>A typical sequence looks like this:</p> |
| |
| <p style="margin-left: 40px;">ServiceTracker<idslmetadataservice, idslmetadataservice=""> tracker = new ServiceTracker<>(<br /> |
| Activator.getContext(), IDSLMetadataService.class, null);<br /> |
| tracker.open();<br /> |
| try {<br /> |
| IDSLMetadataService dslService = tracker.waitForService(5000);<br /> |
| return (ActionToolbar) dslService.getMetadata(toolbarId, ActionDSLPackage.Literals.ACTION_PACKAGE);<br /> |
| } catch (InterruptedException e) {<br /> |
| log.error("", e);<br /> |
| } finally {<br /> |
| tracker.close();<br /> |
| }</idslmetadataservice,></p> |
| |
| <p><idslmetadataservice, idslmetadataservice=""> </idslmetadataservice,></p> |
| |
| <p> </p> |
| |
| <p> </p> |
| </body> |
| </html> |