-
Notifications
You must be signed in to change notification settings - Fork 0
DescribeComponent
Let's start with an example:
@ASAPFormats(formats = {YourComponent.FORMAT_A, YourComponent.FORMAT_B})
public class YourComponent implements SharkComponent, YourFacade {
public static final String FORMAT_A = "myApp://formatA";
public static final String FORMAT_B = "myApp://formatB";
...
}
You component is described by a a single interface (YourComponent
). It must implement SharkComponent
and will usually offer another interfaces that describes all specific methods offered by your application (YourFacade
). Facade Pattern is really a good thing.
The @ASAPFormats
annotation is mandatory. All supported formats must be declared with the formats
parameter. That's it. You have successfully declared your ASAP application as SharkComponent.
There is nice side effect. You might be asked what your component can do. Now you have a brief answer: Read my component interface.
SharkPKI project provides a Public Key Infrastrcuture as Shark Component. Its features are explained in a single interfaces: SharkPKIComponent.
Here are a few lines:
@ASAPFormats(formats = {SharkPKIComponent.CREDENTIAL_APP_NAME, SharkPKIComponent.PKI_APP_NAME})
public interface SharkPKIComponent extends SharkComponent, ASAPKeyStore {...}
This component uses two formats and provides a list of methods. It is worth to give it a closer look. It provides all you need for data encryption and certificate exchange.
Now you need to implement a method that allows others to set initialize your component. Your component does not require any initialization process? Good for your. Method implementation will be very easy for you. Nevertheless, there must be anything others can use.
- What's a hub
- hub information management
- connection management