Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Make ServiceApiSettings provider interfaces public #75

Merged
merged 9 commits into from
Apr 28, 2016

Conversation

michaelbausor
Copy link
Contributor

Make ChannelProvider, ExecutorProvider and CredentialsProvider
interfaces public. This allows the ApiSettings object to be
constructed without instantiating the channel, executor or
credentials until they are required by the Api object.

Make ChannelProvider, ExecutorProvider and CredentialsProvider
interfaces public. This allows the ApiSettings object to be
constructed without instantiating the channel, executor or
credentials until they are required by the Api object.

Pre-push hook installed.

Change-Id: I2b88beb112c24e8e35d5d58b4883bd4be0d15706
Pre-push hook installed.

Change-Id: I6742fae6a8b1052ba1d5a9fc6bcebb90fa87cd7e
*/
interface CredentialsProvider {
public interface CredentialsProvider {

This comment was marked as spam.

Moved interfaces to separate files
Added shouldAutoClose parameter to ExecutorProvider
Added OperationNotSupportedException to ExecutorProvider
and ChannelProvider when a fixed executor/channel is accessed
multiple times.
Updated documentation

Pre-push hook installed.

Change-Id: Icb29408ad0854908932675723a2cc831d0111949
Removed exceptions not thrown
Updated params in javadocs
Fixed broken doc links

Pre-push hook installed.

Change-Id: I2a259ea65dd9a9094a67fdf8d78ad820abf3d7e2
@michaelbausor
Copy link
Contributor Author

PTAL

*
* If the {@link ExecutorProvider} is configured to return a fixed
* {@link ScheduledExecutorService} object and to return shouldAutoClose as true, then after the
* first call to {@link #getExecutor}, subsequent calls should throw an {@link ExecutorProvider}.

This comment was marked as spam.

Changed OperationNotSupportedException to IllegalStateException
Fixed doc errors

Pre-push hook installed.

Change-Id: I33529e918b1e22ce643c03dd46f207a16adfe8ad
@michaelbausor
Copy link
Contributor Author

PTAL
Regarding the tricksy situation you described above, I think that it is actually a valid (although very strange) use case. If the user wants to reuse a fixed channel (setting autoclose to false) but assigns different executors with autoclose set to true then that is fine. The case where they assign the same executor with autoclose true is already handling by the prevention of reusing a resource that will be autoclosed (either executor or channel).

Added unit tests
Removed getOrBuild methods
Set executorProvider in ServiceApiSettings constructor

Pre-push hook installed.

Change-Id: I193be2e6a6ad2e35b5f1def5182e19d9dc14ab29
*/
public Credentials getCredentials() throws IOException {
public Credentials getOrBuildCredentials() throws IOException {

This comment was marked as spam.

Pre-push hook installed.

Change-Id: Icd5d157d0d164f8eb2536778fbafbea7c5c546a2
Pre-push hook installed.

Change-Id: I10039ae000dae902b30a9df43fdd5c1316191281
@michaelbausor
Copy link
Contributor Author

PTAL


/**
* Get the channel to be used to connect to the service. The first time this is called, if the
* channel does not already exist, it will be created.

This comment was marked as spam.

This comment was marked as spam.

Pre-push hook installed.

Change-Id: I4ca6d7d72ad1941846bb9afcb68ee7d518317e3a
@michaelbausor
Copy link
Contributor Author

PTAL

@garrettjonesgoogle
Copy link
Member

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants