@Override public String getName() { return this.config.getName(); } }
@Override public String getName() { return getOriginalConfig().getName(); }
@Override public String getName() { return getOriginalConfig().getName(); }
/** * Gets the name of the member in the GemFire distributed system as determined by the 'name' GemFire property. * Note, this call only works if the API is used in-process. * * @return a String value indicating the name of the member in the GemFire distributed system. */ public String getMemberName() { final InternalDistributedSystem distributedSystem = InternalDistributedSystem.getConnectedInstance(); return (distributedSystem != null ? distributedSystem.getConfig().getName() : null); }
public void test002GetName() { String name = this.getName(); Properties props = new Properties(); props.put(DistributionConfig.NAME_NAME, name); // int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS); // props.setProperty("mcast-port", String.valueOf(unusedPort)); // a loner is all this test needs props.setProperty("mcast-port", "0"); props.setProperty("locators", ""); DistributionConfig config = createSystem(props).getOriginalConfig(); assertEquals(name, config.getName()); }
/** * Gets the name of the member in the GemFire distributed system as determined by the 'name' GemFire property. * Note, this call only works if the API is used in-process. * * @return a String value indicating the name of the member in the GemFire distributed system. */ public String getMemberName() { final InternalDistributedSystem distributedSystem = InternalDistributedSystem.getConnectedInstance(); return (distributedSystem != null ? distributedSystem.getConfig().getName() : null); }
public void execute(FunctionContext context) { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); ArrayList<Object> list = new ArrayList<Object>(); list.add(dc.getCacheXmlFile()); list.add(dc.getName()); context.getResultSender().lastResult(list); }
public void testNonDefaultName() { Properties config = new Properties(); config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); config.setProperty(DistributionConfig.LOCATORS_NAME, ""); config.setProperty(DistributionConfig.NAME_NAME, "nondefault"); InternalDistributedSystem system = getSystem(config); try { assertEquals("nondefault", system.getConfig().getName()); DM dm = system.getDistributionManager(); InternalDistributedMember member = dm.getDistributionManagerId(); assertEquals("nondefault", member.getName()); } finally { system.disconnect(); } }
public void execute(FunctionContext context) { final boolean isRegionContext = context instanceof RegionFunctionContext; RegionFunctionContext regionContext = null; ArrayList<Object> list = new ArrayList<Object>(); if (isRegionContext) { regionContext = (RegionFunctionContext)context; Region region = regionContext.getDataSet(); Set<Object> keys = region.keySet(); Iterator<Object> iterator = keys.iterator(); while (iterator.hasNext()) { list.add(iterator.next()); } if (regionContext.getArguments() != null) { HashSet<Object> args = (HashSet)regionContext.getArguments(); list.removeAll(args); } } else { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); list.add(dc.getName()); if (context.getArguments() != null) { list.add("Insecure item"); } } context.getResultSender().lastResult(list); }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); ArrayList list = new ArrayList(); if (context.getArguments() == null) { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); list.add(dc.getName()); } else { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); } context.getResultSender().lastResult(list); }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); ArrayList list = new ArrayList(); if (context.getArguments() == null) { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); list.add(dc.getName()); } else { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); } context.getResultSender().lastResult(list); }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); ArrayList list = new ArrayList(); if (context.getArguments() == null) { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); list.add(dc.getName()); } else { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); } context.getResultSender().lastResult(list); }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); ArrayList list = new ArrayList(); if (context.getArguments() == null) { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); list.add(dc.getName()); } else { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); } context.getResultSender().lastResult(list); }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); ArrayList list = new ArrayList(); if (context.getArguments() == null) { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); list.add(dc.getName()); } else { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); } context.getResultSender().lastResult(list); }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); ArrayList list = new ArrayList(); if (context.getArguments() == null) { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); list.add(dc.getName()); } else { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); } context.getResultSender().lastResult(list); }
/** * Tests default settings. */ public void testDefaults() { Properties config = new Properties(); config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); config.setProperty(DistributionConfig.LOCATORS_NAME, ""); config.setProperty(DistributionConfig.ROLES_NAME, ""); config.setProperty(DistributionConfig.GROUPS_NAME, ""); config.setProperty(DistributionConfig.NAME_NAME, ""); InternalDistributedSystem system = getSystem(config); try { assertTrue(system.getConfig().getRoles().equals( DistributionConfig.DEFAULT_ROLES)); assertTrue(system.getConfig().getGroups().equals( DistributionConfig.DEFAULT_ROLES)); assertTrue(system.getConfig().getName().equals( DistributionConfig.DEFAULT_NAME)); DM dm = system.getDistributionManager(); InternalDistributedMember member = dm.getDistributionManagerId(); Set roles = member.getRoles(); assertEquals(0, roles.size()); assertEquals("", member.getName()); assertEquals(Collections.emptyList(), member.getGroups()); } finally { system.disconnect(); } }
public void execute(FunctionContext context) { Log.getLogWriter().info("Invoking execute in Inline function"); if (context.getArguments() == null) { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); ArrayList list = new ArrayList(); list.add(dc.getCacheXmlFile()); context.getResultSender().sendResult(list); list.clear(); list.add(dc.getName()); context.getResultSender().lastResult(list); } else { DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); ArrayList list = new ArrayList(); list.add(dc.getCacheXmlFile()); context.getResultSender().lastResult(list); } }
protected void initializeDistributedSystem(DistributedSystem distributedSystem) { InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem; setMemberId(ids.getMemberId()); DistributionConfig config = ids.getConfig(); setMemberName(config.getName()); setMcastPort(config.getMcastPort()); setMcastAddress(config.getMcastAddress()); String bindAddress = config.getBindAddress(); setBindAddress(bindAddress); setLocators(config.getLocators()); setUpTime(System.currentTimeMillis() - ids.getStartTime()); try { setHostAddress((bindAddress != null && bindAddress.length() > 0) ? InetAddress.getByName(bindAddress) : SocketCreator.getLocalHost()); } catch (IOException e) {/*ignore - leave null host address*/} }
protected void initializeDistributedSystem(DistributedSystem distributedSystem) { InternalDistributedSystem ids = (InternalDistributedSystem) distributedSystem; setMemberId(ids.getMemberId()); DistributionConfig config = ids.getConfig(); setMemberName(config.getName()); setMcastPort(config.getMcastPort()); setMcastAddress(config.getMcastAddress()); String bindAddress = config.getBindAddress(); setBindAddress(bindAddress); setLocators(config.getLocators()); setUpTime(System.currentTimeMillis() - ids.getStartTime()); try { setHostAddress((bindAddress != null && bindAddress.length() > 0) ? InetAddress.getByName(bindAddress) : SocketCreator.getLocalHost()); } catch (IOException e) {/*ignore - leave null host address*/} }
getMembershipPortRangeString(distConfig.getMembershipPortRange()); this.systemName = distConfig.getName();