Open Banking Service Activator
Writing a Custom OBServiceObserver¶
WSO2 Open Banking Accelerator contains an OBServiceObserver
component that provides a Java interface to manually execute
methods in non-OSGI modules at the server startup time for both Identity Server and API Manager Servers. A new custom
implementation of OBServiceObserver
executes as a new thread at runtime.
- To implement a custom
OBServiceObserver
, extend the following class:
com.wso2.openbanking.accelerator.service.activator.OBServiceObserver
Given below is a brief explanation of the methods you need to implement.
Activate method¶
This is a public method without any return type or input parameters. You can customize it according to your requirements. Given below is the method signature:
void activate()
Sample implementation:
import com.wso2.openbanking.accelerator.service.activator.OBServiceObserver;
public class CustomObserver implements OBServiceObserver {
@Override
public void activate() {
// invoke the required method
}
}
Configuring a Custom OBServiceObserver¶
- Once implemented, build a JAR file for your
OBServiceObserver
and place it in the
<IS_HOME>/repository/components/dropins
and<APIM_HOME>/repository/components/dropins
directories. - Open the
<IS_HOME>/repository/conf/deployment.toml
file. -
Add a
[open_banking.service_activator.subscribers]
tag and configure it using the Fully Qualified Name (FQN) of your customOBServiceObserver
implementation. executor using the Fully Qualified Name (FQN) of your custom event executor class. For example:[[open_banking.service_activator.subscribers]] subscriber="full.qualified.class.name.ObServiceObserverImpl-1" subscriber="full.qualified.class.name.ObServiceObserverImpl-2"
-
Save the above configurations and restart the Identity Server.
- Repeat steps 2 and 3 for API Manager using the
<APIM_HOME>/repository/conf/deployment.toml
file. - Restart the API Manager server.