@Test(expected = IllegalArgumentException.class) public void testActivateWithNullContext() { service.activate(null); }
void activate(ComponentContext context) { if (context == null) throw new IllegalArgumentException("Component context must not be null"); name = StringUtils.trimToNull(context.getBundleContext().getProperty(OPT_INSTANCE_NAME)); if (name != null) logger.info("Instance name is '{}'", name); else logger.debug("No explicit instance name has been set"); }
InstanceInformation { void activate(ComponentContext context) { if (context == null) throw new IllegalArgumentException("Component context must not be null"); name = StringUtils.trimToNull(context.getBundleContext().getProperty(OPT_INSTANCE_NAME)); if (name != null) logger.info("Instance name is '{}'", name); else logger.debug("No explicit instance name has been set"); } }
InstanceInformation { void activate(ComponentContext context) { if (context == null) throw new IllegalArgumentException("Component context must not be null"); name = StringUtils.trimToNull(context.getBundleContext().getProperty(OPT_INSTANCE_NAME)); if (name != null) logger.info("Instance name is '{}'", name); else logger.debug("No explicit instance name has been set"); }  }
InstanceInformation { void activate(ComponentContext context) { if (context == null) throw new IllegalArgumentException("Component context must not be null"); name = StringUtils.trimToNull(context.getBundleContext().getProperty(OPT_INSTANCE_NAME)); if (name != null) logger.info("Instance name is '{}'", name); else logger.debug("No explicit instance name has been set"); }  String getName(); }
InstanceInformation { void activate(ComponentContext context) { if (context == null) throw new IllegalArgumentException("Component context must not be null"); name = StringUtils.trimToNull(context.getBundleContext().getProperty(OPT_INSTANCE_NAME)); if (name != null) logger.info("Instance name is '{}'", name); else logger.debug("No explicit instance name has been set"); }  String getName();  }