Package net.jini.core.entry

Examples of net.jini.core.entry.Entry


    /**
     * Create the service-owned attributes for an Outrigger server.
     */
    private static Entry[] attributesFor() {
  final Entry info = new ServiceInfo("JavaSpace",
      "Sun Microsystems, Inc.", "Sun Microsystems, Inc.",
      com.sun.jini.constants.VersionConstants.SERVER_VERSION, "", "");
 
  final Entry type =
      new com.sun.jini.lookup.entry.BasicServiceType("JavaSpace");

  return new Entry[]{info, type};
    }
View Full Code Here


    private void genEntries(StringBuffer buf,
          Entry[] entries,
          boolean showNulls)
    {
  for (int i = 0; i < entries.length; i++) {
      Entry ent = entries[i];
      if (ent == null) {
    buf.append("null\n");
    continue;
      }
      buf.append(typeName(ent.getClass()));
      buf.append(": ");
      try {
    Field[] fields = ent.getClass().getFields();
    for (int j = 0; j < fields.length; j++) {
        if (!valid(fields[j]))
      continue;
        Object val = fields[j].get(ent);
        if (val != null || showNulls) {
View Full Code Here

  public AttrSet(Class type) {
      this.type = type;
  }

  public void actionPerformed(ActionEvent ev) {
      Entry ent;
      try {
    ent = (Entry)type.newInstance();
      } catch (Throwable t) {
    logger.log(Level.INFO, "creating entry failed", t);
    return;
View Full Code Here

  public void menuSelected(MenuEvent ev) {
      JRadioButtonMenuItem match = new JRadioButtonMenuItem("(match)");
      match.setSelected(true);
      match.addActionListener(wrap(new Unmatch(index)));
      menu.add(match);
      Entry ent = tmpl.attributeSetTemplates[index];
      Field[] fields = ent.getClass().getFields();
      for (int i = 0; i < fields.length; i++) {
    Field field = fields[i];
    if (!valid(field))
        continue;
    try {
View Full Code Here

  }
  check(attrSetTmpls, false);
  check(modAttrSets, true);
  attrSets = (Entry[])attrSets.clone();
  for (int i = attrSets.length; --i >= 0; ) {
      Entry pre = attrSets[i];
      for (int j = attrSetTmpls.length; --j >= 0; ) {
    if (matches(attrSetTmpls[j], pre)) {
        if (checkSC)
      check(pre);
        Entry mods = modAttrSets[j];
        if (mods == null) {
      attrSets = delete(attrSets, i);
      break;
        } else {
      attrSets[i] = update(attrSets[i], mods);
View Full Code Here

     * array is <code>null</code>, a <code>NullPointerException</code>
     * is thrown.
     */
    public static void check(Entry[] attrs, boolean nullOK) {
  for (int i = attrs.length; --i >= 0; ) {
      Entry e = attrs[i];
      if (e == null && nullOK)
    continue;
      Class c = e.getClass();
      if (!Modifier.isPublic(c.getModifiers()))
    throw new IllegalArgumentException("entry class " +
               c.getName() +
               " is not public");
      try {
View Full Code Here

    /**
     * Test if the set at the given <code>index</code> is equal to any
     * other set earlier in the <code>Entry[]</code> array parameter.
     */
    private static boolean isDup(Entry[] attrs, int index) {
  Entry set = attrs[index];
  for (int i = index; --i >= 0; ) {
      if (equal(set, attrs[i]))
    return true;
  }
  return false;
View Full Code Here

     * <code>mods</code>, else the same field value as the parameter
     * <code>e</code>.
     */
    private static Entry update(Entry e, Entry mods) {
  try {
      Entry ec = (Entry)e.getClass().newInstance();
      Field[] mfields = getFields(mods);
      Field[] efields = getFields(e, mods, mfields);
      for (int i = efields.length; --i >= 0; ) {
    efields[i].set(ec, efields[i].get(e));
      }
View Full Code Here

    private void genEntries(StringBuffer buf,
          Entry[] entries,
          boolean showNulls)
    {
  for (int i = 0; i < entries.length; i++) {
      Entry ent = entries[i];
      if (ent == null) {
    buf.append("null\n");
    continue;
      }
      buf.append(typeName(ent.getClass()));
      buf.append(": ");
      try {
    Field[] fields = ent.getClass().getFields();
    for (int j = 0; j < fields.length; j++) {
        if (!valid(fields[j]))
      continue;
        Object val = fields[j].get(ent);
        if (val != null || showNulls) {
View Full Code Here

    /**
     * Create the service-owned attributes for an Outrigger server.
     */
    private static Entry[] attributesFor() {
  final Entry info = new ServiceInfo("JavaSpace",
      "Sun Microsystems, Inc.", "Sun Microsystems, Inc.",
      com.sun.jini.constants.VersionConstants.SERVER_VERSION, "", "");
 
  final Entry type =
      new com.sun.jini.lookup.entry.BasicServiceType("JavaSpace");

  return new Entry[]{info, type};
    }
View Full Code Here

TOP

Related Classes of net.jini.core.entry.Entry

Copyright © 2018 www.massapicom. 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.