@SuppressWarnings("deprecation") @Override protected String getDomainInternal() { Container container = getContainer(); if (container == null) { return null; } return MBeanUtils.getDomain(container); }
@Override protected String getDomainInternal() { Container container = getContainer(); if (container == null) { return null; } return container.getDomain(); }
@Override protected String getObjectNameKeyProperties() { StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); if (container != null) { name.append(container.getMBeanKeyProperties()); } return name.toString(); }
@SuppressWarnings("deprecation") @Override protected String getObjectNameKeyProperties() { StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); if (container != null) { name.append(MBeanUtils.getContainerKeyProperties(container)); } return name.toString(); }
@Override protected String getDomainInternal() { Container container = getContainer(); if (container == null) { return null; } return container.getDomain(); }
@Override protected String getObjectNameKeyProperties() { StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); if (container != null) { name.append(container.getMBeanKeyProperties()); } return name.toString(); }
private static ObjectName getDefaultClusterName(SimpleTcpCluster cluster) throws Exception { String domain = getMBeanServer().getDefaultDomain(); String type = ":type="; String clusterType= type+"Cluster"; if (cluster.getContainer() instanceof StandardHost) { domain = ((StandardHost) cluster.getContainer()).getDomain(); clusterType += ",host=" + cluster.getContainer().getName(); } else { if (cluster.getContainer() instanceof StandardEngine) { domain = ((StandardEngine) cluster.getContainer()).getDomain(); } } ObjectName clusterName = new ObjectName(domain + clusterType); return clusterName; }
@SuppressWarnings("deprecation") @Override protected void initInternal() throws LifecycleException { super.initInternal(); if (clusterDeployer != null) { StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); name.append(MBeanUtils.getContainerKeyProperties(container)); name.append(",component=Deployer"); onameClusterDeployer = register(clusterDeployer, name.toString()); } }
@SuppressWarnings("deprecation") private void registerMember(Member member) { // JMX registration StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); if (container != null) { name.append(MBeanUtils.getContainerKeyProperties(container)); } name.append(",component=Member,name="); name.append(ObjectName.quote(member.getName())); ObjectName oname = register(member, name.toString()); memberOnameMap.put(member, oname); }
private void registerMember(Member member) { // JMX registration StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); if (container != null) { name.append(container.getMBeanKeyProperties()); } name.append(",component=Member,name="); name.append(ObjectName.quote(member.getName())); ObjectName oname = register(member, name.toString()); memberOnameMap.put(member, oname); }
private void registerMember(Member member) { // JMX registration StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); if (container != null) { name.append(container.getMBeanKeyProperties()); } name.append(",component=Member,name="); name.append(ObjectName.quote(member.getName())); ObjectName oname = register(member, name.toString()); memberOnameMap.put(member, oname); }
@Override protected void initInternal() throws LifecycleException { super.initInternal(); if (clusterDeployer != null) { StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); if (container != null) { name.append(container.getMBeanKeyProperties()); } name.append(",component=Deployer"); onameClusterDeployer = register(clusterDeployer, name.toString()); } }
/** * unregister all cluster valve to host or engine * @throws Exception * @throws ClassNotFoundException */ protected void unregisterClusterValve() throws Exception { for (Iterator<Valve> iter = valves.iterator(); iter.hasNext();) { ClusterValve valve = (ClusterValve) iter.next(); if (log.isDebugEnabled()) log.debug("Invoking removeValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { IntrospectionUtils.callMethodN(getContainer(), "removeValve", new Object[] { valve }, new Class[] { org.apache.catalina.Valve.class }); valve.setCluster(this); } } }
/** * unregister all cluster valve to host or engine * @throws Exception * @throws ClassNotFoundException */ protected void unregisterClusterValve() throws Exception { for (Iterator<Valve> iter = valves.iterator(); iter.hasNext();) { ClusterValve valve = (ClusterValve) iter.next(); if (log.isDebugEnabled()) log.debug("Invoking removeValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { IntrospectionUtils.callMethodN(getContainer(), "removeValve", new Object[] { valve }, new Class[] { org.apache.catalina.Valve.class }); valve.setCluster(this); } } }
/** * register all cluster valve to host or engine * @throws Exception * @throws ClassNotFoundException */ protected void registerClusterValve() throws Exception { if(container != null ) { for (Iterator<Valve> iter = valves.iterator(); iter.hasNext();) { ClusterValve valve = (ClusterValve) iter.next(); if (log.isDebugEnabled()) log.debug("Invoking addValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { IntrospectionUtils.callMethodN(getContainer(), "addValve", new Object[] { valve }, new Class[] { org.apache.catalina.Valve.class }); valve.setCluster(this); } } } }
@Override protected void initInternal() throws LifecycleException { super.initInternal(); if (clusterDeployer != null) { StringBuilder name = new StringBuilder("type=Cluster"); Container container = getContainer(); if (container != null) { name.append(container.getMBeanKeyProperties()); } name.append(",component=Deployer"); onameClusterDeployer = register(clusterDeployer, name.toString()); } channel.setUtilityExecutor(Container.getService(getContainer()).getServer().getUtilityExecutor()); }
/** * unregister all cluster valve to host or engine */ protected void unregisterClusterValve() { for (Valve v : valves) { ClusterValve valve = (ClusterValve) v; if (log.isDebugEnabled()) log.debug("Invoking removeValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { container.getPipeline().removeValve(valve); valve.setCluster(null); } } }
/** * register all cluster valve to host or engine */ protected void registerClusterValve() { if(container != null ) { for (Valve v : valves) { ClusterValve valve = (ClusterValve) v; if (log.isDebugEnabled()) log.debug("Invoking addValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { container.getPipeline().addValve(valve); valve.setCluster(this); } } } }
@Override public String getManagerName(String name, Manager manager) { String clusterName = name ; if (clusterName == null) clusterName = manager.getContext().getName(); if (getContainer() instanceof Engine) { Context context = manager.getContext(); Container host = context.getParent(); if (host instanceof Host && clusterName != null && !(clusterName.startsWith(host.getName() +"#"))) { clusterName = host.getName() +"#" + clusterName ; } } return clusterName; }
public SimpleTomEETcpCluster(final SimpleTcpCluster from) { clusterListeners.addAll(Arrays.asList(from.findClusterListeners())); setClusterName(from.getClusterName()); setContainer(from.getContainer()); setNotifyLifecycleListenerOnFailure(from.isNotifyLifecycleListenerOnFailure()); setChannelSendOptions(from.getChannelSendOptions()); setChannelStartOptions(from.getChannelStartOptions()); setHeartbeatBackgroundEnabled(from.isHeartbeatBackgroundEnabled()); setChannel(from.getChannel()); getManagers().putAll(from.getManagers()); setManagerTemplate(from.getManagerTemplate()); setClusterDeployer(from.getClusterDeployer()); for (final Valve valve : from.getValves()) { addValve(valve); } }