use of org.eclipse.ecf.core.security.IConnectInitiatorPolicy in project ecf by eclipse.
the class GenericAuthConsumerContainerSelector method createContainer.
@Override
protected IRemoteServiceContainer createContainer(ContainerTypeDescription containerTypeDescription, String containerTypeDescriptionName, @SuppressWarnings("rawtypes") Map properties) throws SelectContainerException {
IRemoteServiceContainer result = super.createContainer(containerTypeDescription, containerTypeDescriptionName, properties);
ISharedObjectContainerClient client = (ISharedObjectContainerClient) result.getContainer().getAdapter(ISharedObjectContainerClient.class);
if (client != null) {
client.setConnectInitiatorPolicy(new IConnectInitiatorPolicy() {
public void refresh() {
}
public Object createConnectData(IContainer container, ID targetID, IConnectContext context) {
// to the server.
return getConnectData();
}
public int getConnectTimeout() {
return 30000;
}
});
}
return result;
}
use of org.eclipse.ecf.core.security.IConnectInitiatorPolicy 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;
}
use of org.eclipse.ecf.core.security.IConnectInitiatorPolicy 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;
}
Aggregations