Search in sources :

Example 1 with ClientSOContainer

use of org.eclipse.ecf.provider.generic.ClientSOContainer in project ecf by eclipse.

the class GenericClientApplication method createContainer.

protected ISharedObjectContainer createContainer() throws ContainerCreateException {
    IContainerFactory f = Activator.getDefault().getContainerManager().getContainerFactory();
    ClientSOContainer client = (ClientSOContainer) ((clientId == null) ? f.createContainer(GENERIC_CLIENT_CONTAINER_TYPE) : f.createContainer(GENERIC_CLIENT_CONTAINER_TYPE, clientId));
    if (password != null) {
        client.setConnectInitiatorPolicy(new IConnectInitiatorPolicy() {

            public void refresh() {
            // nothing
            }

            public Object createConnectData(IContainer container, ID targetID, IConnectContext context) {
                return password;
            }

            public int getConnectTimeout() {
                return 30000;
            }
        });
    }
    return client;
}
Also used : IConnectContext(org.eclipse.ecf.core.security.IConnectContext) ClientSOContainer(org.eclipse.ecf.provider.generic.ClientSOContainer) IConnectInitiatorPolicy(org.eclipse.ecf.core.security.IConnectInitiatorPolicy) ID(org.eclipse.ecf.core.identity.ID)

Example 2 with ClientSOContainer

use of org.eclipse.ecf.provider.generic.ClientSOContainer in project ecf by eclipse.

the class SSLGenericClientApplication method createContainer.

protected ISharedObjectContainer createContainer() throws ContainerCreateException {
    IContainerFactory f = Activator.getDefault().getContainerManager().getContainerFactory();
    ClientSOContainer client = (ClientSOContainer) ((clientId == null) ? f.createContainer(GENERIC_SSL_CLIENT) : f.createContainer(GENERIC_SSL_CLIENT, clientId));
    if (password != null) {
        client.setConnectInitiatorPolicy(new IConnectInitiatorPolicy() {

            public void refresh() {
            // nothing
            }

            public Object createConnectData(IContainer container, ID targetID, IConnectContext context) {
                return password;
            }

            public int getConnectTimeout() {
                return 30000;
            }
        });
    }
    return client;
}
Also used : IConnectContext(org.eclipse.ecf.core.security.IConnectContext) ClientSOContainer(org.eclipse.ecf.provider.generic.ClientSOContainer) IConnectInitiatorPolicy(org.eclipse.ecf.core.security.IConnectInitiatorPolicy) ID(org.eclipse.ecf.core.identity.ID)

Aggregations

ID (org.eclipse.ecf.core.identity.ID)2 IConnectContext (org.eclipse.ecf.core.security.IConnectContext)2 IConnectInitiatorPolicy (org.eclipse.ecf.core.security.IConnectInitiatorPolicy)2 ClientSOContainer (org.eclipse.ecf.provider.generic.ClientSOContainer)2