Re: get controller service's configuration

2017-08-11 Thread 尹文才
Thanks for your explanation Bryan, it seems that I could only get the DBCP controller service's driver name after something like getDrivername() is added into the current DBCPService interface. Regards, Ben 2017-08-10 22:01 GMT+08:00 Bryan Bende : > The way controller services

Re: get controller service's configuration

2017-08-10 Thread Bryan Bende
The way controller services are setup you have the following... - DBCPService interface (provides getConnection()) extends ControllerService interface (empty interface to indicate it is a CS) - DBCPConnectionPool extends AbstractControllerService implements DBCPService - Processor XYZ depends on

Re: get controller service's configuration

2017-08-10 Thread 尹文才
Thanks Andy, I've tried your approach, in my case the controller service is a DBCPConnectionPool and when I tried to get driver class name property through context.getProperty(DBCPConnectionPool.DB_DRIVERNAME).getValue(), but I the value is null. The AbstractControllerService class does have a

Re: get controller service's configuration

2017-08-09 Thread Andy LoPresto
You can get the current property values of a controller service from the processor by using the ProcessContext object. For example, in GetHTTP [1], in the @OnScheduled method, you could do: context.getControllerServiceLookup().getControllerService("my-controller-service-id”);

Re: get controller service's configuration

2017-08-09 Thread 尹文才
Thanks Koji, I checked the link you provided and I think getting a DataSource is no different than getting the DBCP service(they could just get the connection). Actually I was trying to get the configured driver class to check the database type. Regards, Ben 2017-08-10 9:29 GMT+08:00 Koji

Re: get controller service's configuration

2017-08-09 Thread Koji Kawamura
Hi Ben, I'm not aware of ways to obtain configurations of a controller from a processor. Those should be encapsulated inside a controller service. If you'd like to create DataSource instance instead of just obtaining a connection, this discussion might be helpful:

get controller service's configuration

2017-08-09 Thread 尹文才
Hi guys, I have a customized processor with a DBCP controller service as a property. I could get the DBCP controller service in my code, but does anyone know how to obtain all the configurations of the DBCP controller service in java code(e.g. Database Connection URL, Database Driver Location,