use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.
the class OpenshiftContainerProvider method activate.
@Activate
void activate(Map<String, ?> configuration) throws Exception {
updateConfiguration(configuration);
configurer.configure(configuration, this);
activateComponent();
if (mbeanServer != null) {
objectName = new ObjectName("io.fabric8:type=OpenShift");
mbean = new OpenShiftFacade(this);
if (!mbeanServer.isRegistered(objectName)) {
mbeanServer.registerMBean(mbean, objectName);
}
}
}
use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.
the class OpenShiftDeployAgent method activate.
@Activate
void activate(Map<String, ?> configuration) {
// this.realm = properties != null && properties.containsKey(REALM_PROPERTY_NAME) ? properties.get(REALM_PROPERTY_NAME) : DEFAULT_REALM;
// this.role = properties != null && properties.containsKey(ROLE_PROPERTY_NAME) ? properties.get(ROLE_PROPERTY_NAME) : DEFAULT_ROLE;
group = new ZooKeeperGroup(curator.get(), ZkPath.OPENSHIFT.getPath(), ControllerNode.class);
group.add(this);
group.update(createState());
group.start();
activateComponent();
}
use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.
the class MQCreate method activate.
@Activate
void activate() {
bindOptionalCompleter("--kind", new BrokerKindCompleter());
activateComponent();
}
use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.
the class MavenProxyRegistrationHandler method init.
@Activate
void init(Map<String, ?> configuration) throws Exception {
configurer.get().configure(configuration, this);
if (uploadRepository == null) {
uploadRepository = runtimeProperties.get().getProperty("runtime.data") + "/maven/upload";
}
int timeout = -1;
if (configAdmin.getOptional() != null) {
ConfigurationAdmin ca = configAdmin.get();
Configuration c = ca.getConfiguration("io.fabric8.agent", null);
if (c != null && c.getProperties() != null) {
String t = (String) c.getProperties().get("org.ops4j.pax.url.mvn.socket.readTimeout");
if (t == null) {
t = (String) c.getProperties().get("org.ops4j.pax.url.mvn.timeout");
}
if (t != null) {
try {
timeout = Integer.parseInt(t);
} catch (NumberFormatException ignored) {
}
}
}
}
this.mavenDownloadProxyServlet = new MavenDownloadProxyServlet(mavenResolver.get(), runtimeProperties.get(), projectDeployer.get(), threadMaximumPoolSize, timeout);
this.mavenDownloadProxyServlet.start();
this.mavenUploadProxyServlet = new MavenUploadProxyServlet(mavenResolver.get(), runtimeProperties.get(), projectDeployer.get(), new File(uploadRepository), timeout);
this.mavenUploadProxyServlet.start();
try {
HttpContext base = httpService.get().createDefaultHttpContext();
HttpContext secure = new MavenSecureHttpContext(base, realm, role);
httpService.get().registerServlet("/maven/download", mavenDownloadProxyServlet, createParams("maven-download"), base);
httpService.get().registerServlet("/maven/upload", mavenUploadProxyServlet, createParams("maven-upload"), secure);
} catch (Throwable t) {
LOGGER.warn("Failed to register fabric maven proxy servlets, due to:" + t.getMessage());
}
activateComponent();
}
use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.
the class FabricGitServiceImpl method activate.
@Activate
@VisibleForTesting
public void activate() throws IOException {
RuntimeProperties sysprops = runtimeProperties.get();
localRepo = sysprops.getDataPath().resolve(DEFAULT_GIT_PATH).toFile();
if (!localRepo.exists() && !localRepo.mkdirs()) {
throw new IOException("Failed to create local repository at:" + localRepo.getAbsolutePath());
}
git = openOrInit(localRepo);
activateComponent();
}
Aggregations