protected Container getContainer(ConfigurationFactory configFactory, ContainerFactory containerFactory, String id) {
if (hostname != null) {
AbstractRuntimeConfiguration config = (AbstractRuntimeConfiguration) configFactory.createConfiguration(id, ContainerType.REMOTE, ConfigurationType.RUNTIME);
configure(config);
config.setProperty(RemotePropertySet.USERNAME, userName);
config.setProperty(RemotePropertySet.PASSWORD, getPassword());
config.setProperty(GeneralPropertySet.HOSTNAME, hostname);
AbstractRemoteContainer container = (AbstractRemoteContainer) containerFactory.createContainer(id, ContainerType.REMOTE, config);
return container;