1 23 24 25 26 39 40 package com.sun.enterprise.config.impl; 41 42 43 44 import java.io.Serializable ; 45 46 import java.util.HashMap ; 47 48 import java.util.Set ; 49 50 import java.util.Iterator ; 51 52 53 54 import com.sun.enterprise.config.ConfigBean; 55 import com.sun.enterprise.config.ConfigContext; 56 import com.sun.enterprise.config.util.LoggerHelper; 57 import com.sun.enterprise.config.util.ConfigXPathHelper; 58 import com.sun.enterprise.config.ConfigException; 59 import java.io.IOException ; 60 61 62 69 70 public class ConfigAddImpl extends ConfigChangeImpl implements com.sun.enterprise.config.ConfigAdd, Serializable { 71 72 73 74 private ConfigBean cb; 75 76 private String name; 77 78 79 80 public String getConfigChangeType() { 81 82 return TYPE_ADD; 83 84 } 85 86 87 88 public ConfigAddImpl(String parentXpath, String childXpath, String name, ConfigBean cb) { 89 90 this.xpath = childXpath; 91 92 this.cb = cb; 93 94 this.name = name; 95 96 this.parentXpath = parentXpath; 97 98 } 99 100 public ConfigAddImpl(ConfigContext ctx, String xpath) throws ConfigException { 101 this.cb = (ConfigBean) ctx.getRootConfigBean().clone(); 102 this.xpath = xpath; 103 this.name = ConfigXPathHelper.getLastNodeName(xpath); 104 this.parentXpath = ConfigXPathHelper.getParentXPath(xpath); 105 } 106 107 public ConfigBean getConfigBean() { 108 109 return cb; 110 111 } 112 113 114 115 public String getName() { 116 117 return name; 118 119 } 120 121 127 private void writeObject(java.io.ObjectOutputStream out) 128 throws IOException { 129 130 synchronized (this) { 131 out.writeObject(cb); 132 out.writeObject(name); 133 } 134 } 135 136 142 private void readObject(java.io.ObjectInputStream in) 143 throws IOException , ClassNotFoundException { 144 145 synchronized (this) { 146 cb = (ConfigBean) in.readObject(); 147 name = (String ) in.readObject(); 148 } 149 } 150 151 public String toString() { 152 153 String ret = cb.toString() + ":add to xpath=" + getParentXPath() +"\n" 154 155 + "childXPath = " + getXPath(); 156 157 return ret; 158 159 } 160 161 } 162 163 | Popular Tags |