Examples of ServerRef


Examples of com.sun.enterprise.config.serverbeans.ServerRef

        Object newVal;
        for (PropertyChangeEvent event : events) {
            oldVal = event.getOldValue();
            newVal = event.getNewValue();
            if (oldVal instanceof ServerRef && newVal == null) {
                ServerRef instance = (ServerRef) oldVal;
                deleteInstance(instance.getRef());
            } else if (newVal instanceof ServerRef && oldVal == null) {
                ServerRef instance = (ServerRef) newVal;
                addInstance(instance.getRef());
            }
        }
        return null;
    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.ServerRef

    }

    private void addServerToLBConfig(final LbConfigs lbconfigs, final String configName, final String serverName) {
        LbConfig lbConfig = lbconfigs.getLbConfig(configName);

        ServerRef sRef = lbConfig.getRefByRef(ServerRef.class, serverName);
        if (sRef != null) {
            String msg = localStrings.getLocalString("LBServerRefExists",
                   "LB config already contains a server-ref for target {0}", target);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(msg);
            return;
        }

        Server server = domain.getServerNamed(serverName);
        boolean isStandAlone = server.getCluster() == null && server.isInstance();
        if (!isStandAlone) {
            String msg = localStrings.getLocalString("NotStandAloneInstance",
                    "[{0}] is not a stand alone instance. Only stand alone instance can be added to a load balancer.",
                    serverName);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(msg);
            return;
        }

        try {
            ConfigSupport.apply(new SingleConfigCode<LbConfig>() {
                @Override
                public Object run(LbConfig param) throws PropertyVetoException, TransactionFailure {
                    ServerRef ref = param.createChild(ServerRef.class);
                    ref.setRef(serverName);
                    param.getClusterRefOrServerRef().add(ref);
                    return Boolean.TRUE;
                }
            }, lbConfig);
        } catch (TransactionFailure ex) {
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.ServerRef

                if (domain.getClusterNamed(target) != null) {
                   ClusterRef cRef = instance.createChild(ClusterRef.class);
                   cRef.setRef(target);
                   instance.getClusterRefOrServerRef().add(cRef);
                } else if (domain.isServer(target)) {
                    ServerRef sRef = instance.createChild(ServerRef.class);
                    sRef.setRef(target);
                    instance.getClusterRefOrServerRef().add(sRef);
                } else {
                    String msg = localStrings.getLocalString("InvalidTarget", target);
                    throw new TransactionFailure(msg);
                }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.ServerRef

        Object newVal;
        for (PropertyChangeEvent event : events) {
            oldVal = event.getOldValue();
            newVal = event.getNewValue();
            if (oldVal instanceof ServerRef && newVal == null) {
                ServerRef instance = (ServerRef) oldVal;
                deleteInstance(instance.getRef());
            } else if (newVal instanceof ServerRef && oldVal == null) {
                ServerRef instance = (ServerRef) newVal;
                addInstance(instance.getRef());
            }
        }
        return null;
    }
View Full Code Here

Examples of org.xmlBlaster.util.qos.address.ServerRef

         // No login using the connect() method ...
         ConnectReturnQosServer returnQos = connectIntern(loginQos.toXml());

         // Build return handle ...
         ServerRef ref = returnQos.getServerRef();
         if (ref == null) {
            throw OrbInstanceFactory.convert(new org.xmlBlaster.util.XmlBlasterException(glob,
                     ErrorCode.INTERNAL_CONNECTIONFAILURE,
                     ME,
                     "Can't determine server reference."));
         }
         String xmlBlasterIOR = ref.getAddress();
         org.xmlBlaster.protocol.corba.serverIdl.Server xmlBlaster =
                            ServerHelper.narrow(orb.string_to_object(xmlBlasterIOR));
         return xmlBlaster;
      }
      catch (org.xmlBlaster.util.XmlBlasterException e) {
View Full Code Here

Examples of org.xmlBlaster.util.qos.address.ServerRef

         returnQos.removeServerRef("IOR");
      }

      org.xmlBlaster.protocol.corba.serverIdl.Server xmlBlaster = org.xmlBlaster.protocol.corba.serverIdl.ServerHelper.narrow(certificatedServerRef);
      String serverIOR = orb.object_to_string(xmlBlaster);
      returnQos.addServerRef(new ServerRef("IOR", serverIOR));

      if (log.isLoggable(Level.FINEST)) log.finest("Returning from login-connect()" + returnQos.toXml());

      return returnQos;
   }
View Full Code Here

Examples of org.xmlBlaster.util.qos.address.ServerRef

         protected I_ClientPlugin getPlugin(String mechanism, String version) throws XmlBlasterException
         public String getSecurityData() {
         */
         ServerRef[] refArr = qos.getServerRefs();
         assertEquals("", 3, refArr.length);
         ServerRef ref = qos.getServerRef();
         assertTrue("", ref != null);
         /*
         public ClientQueueProperty getClientQueueProperty() {
         public final I_SecurityQos getSecurityQos() throws XmlBlasterException
         public final String getSecurityPluginType() throws XmlBlasterException
View Full Code Here

Examples of org.xmlBlaster.util.qos.address.ServerRef

         }
         if (type == null) {
            log.severe("Missing 'serverRef' attribute 'type' in login-qos");
            type = AddressBase.DEFAULT_type;// Since 1.0.7 "SOCKET", before "IOR";
         }
         tmpServerRef = new ServerRef(type);
         if (tmp.length() > 0) {
            tmpServerRef.setAddress(tmp);
            character.setLength(0);
         }
         return;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.