ZoneManager.java 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver.instancemanager;
  16. import java.io.File;
  17. import java.lang.reflect.Constructor;
  18. import java.sql.Connection;
  19. import java.sql.PreparedStatement;
  20. import java.sql.ResultSet;
  21. import java.util.Collection;
  22. import java.util.Iterator;
  23. import java.util.List;
  24. import java.util.Map;
  25. import java.util.logging.Level;
  26. import java.util.logging.Logger;
  27. import javax.xml.parsers.DocumentBuilderFactory;
  28. import javolution.util.FastList;
  29. import javolution.util.FastMap;
  30. import org.w3c.dom.Document;
  31. import org.w3c.dom.NamedNodeMap;
  32. import org.w3c.dom.Node;
  33. import com.l2jserver.Config;
  34. import com.l2jserver.L2DatabaseFactory;
  35. import com.l2jserver.gameserver.model.L2ItemInstance;
  36. import com.l2jserver.gameserver.model.L2Object;
  37. import com.l2jserver.gameserver.model.L2World;
  38. import com.l2jserver.gameserver.model.L2WorldRegion;
  39. import com.l2jserver.gameserver.model.actor.L2Character;
  40. import com.l2jserver.gameserver.model.zone.L2SpawnZone;
  41. import com.l2jserver.gameserver.model.zone.L2ZoneType;
  42. import com.l2jserver.gameserver.model.zone.form.ZoneCuboid;
  43. import com.l2jserver.gameserver.model.zone.form.ZoneCylinder;
  44. import com.l2jserver.gameserver.model.zone.form.ZoneNPoly;
  45. import com.l2jserver.gameserver.model.zone.type.L2ArenaZone;
  46. import com.l2jserver.gameserver.model.zone.type.L2OlympiadStadiumZone;
  47. /**
  48. * This class manages the zones
  49. *
  50. * @author durgus
  51. */
  52. public class ZoneManager
  53. {
  54. private static final Logger _log = Logger.getLogger(ZoneManager.class.getName());
  55. //private final FastMap<Integer, L2ZoneType> _zones = new FastMap<Integer, L2ZoneType>();
  56. private final Map<Class<? extends L2ZoneType>, Map<Integer, ? extends L2ZoneType>> _classZones = new FastMap<Class<? extends L2ZoneType>, Map<Integer, ? extends L2ZoneType>>();
  57. private int _lastDynamicId = 300000;
  58. private List<L2ItemInstance> _debugItems;
  59. public static final ZoneManager getInstance()
  60. {
  61. return SingletonHolder._instance;
  62. }
  63. // =========================================================
  64. // Data Field
  65. // =========================================================
  66. // Constructor
  67. private ZoneManager()
  68. {
  69. load();
  70. }
  71. @SuppressWarnings("deprecation")
  72. public void reload()
  73. {
  74. // int zoneCount = 0;
  75. // Get the world regions
  76. int count = 0;
  77. L2WorldRegion[][] worldRegions = L2World.getInstance().getAllWorldRegions();
  78. for (int x = 0; x < worldRegions.length; x++)
  79. {
  80. for (int y = 0; y < worldRegions[x].length; y++)
  81. {
  82. worldRegions[x][y].getZones().clear();
  83. count++;
  84. }
  85. }
  86. GrandBossManager.getInstance().getZones().clear();
  87. _log.info("Removed zones in " + count + " regions.");
  88. // Load the zones
  89. load();
  90. for (L2Object o : L2World.getInstance().getAllVisibleObjects().values())
  91. {
  92. if (o instanceof L2Character)
  93. ((L2Character) o).revalidateZone(true);
  94. }
  95. }
  96. // =========================================================
  97. // Method - Private
  98. private final void load()
  99. {
  100. _log.info("Loading zones...");
  101. Connection con = null;
  102. PreparedStatement statement = null;
  103. _classZones.clear();
  104. // Get the world regions
  105. L2WorldRegion[][] worldRegions = L2World.getInstance().getAllWorldRegions();
  106. // Load the zone xml
  107. try
  108. {
  109. // Get a sql connection here
  110. con = L2DatabaseFactory.getInstance().getConnection();
  111. statement = con.prepareStatement("SELECT x,y FROM zone_vertices WHERE id=? ORDER BY 'order' ASC ");
  112. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  113. factory.setValidating(false);
  114. factory.setIgnoringComments(true);
  115. final File dir = new File(Config.DATAPACK_ROOT, "data/zones");
  116. if (!dir.exists())
  117. {
  118. _log.config("Dir " + dir.getAbsolutePath() + " not exists");
  119. return;
  120. }
  121. File[] files = dir.listFiles();
  122. FastList<File> hash = new FastList<File>(files.length);
  123. for (File f : files)
  124. {
  125. // default file first
  126. if ("zone.xml".equalsIgnoreCase(f.getName()))
  127. hash.addFirst(f);
  128. else if (f.getName().endsWith(".xml"))
  129. hash.add(f);
  130. }
  131. Document doc;
  132. NamedNodeMap attrs;
  133. Node attribute;
  134. String zoneName;
  135. int[][] coords;
  136. int zoneId, minZ, maxZ;
  137. String zoneType, zoneShape;
  138. for (File f : hash)
  139. {
  140. doc = factory.newDocumentBuilder().parse(f);
  141. for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
  142. {
  143. if ("list".equalsIgnoreCase(n.getNodeName()))
  144. {
  145. attrs = n.getAttributes();
  146. attribute = attrs.getNamedItem("enabled");
  147. if (attribute != null && !Boolean.parseBoolean(attribute.getNodeValue()))
  148. continue;
  149. for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
  150. {
  151. if ("zone".equalsIgnoreCase(d.getNodeName()))
  152. {
  153. attrs = d.getAttributes();
  154. attribute = attrs.getNamedItem("id");
  155. if (attribute != null)
  156. zoneId = Integer.parseInt(attribute.getNodeValue());
  157. else
  158. zoneId = _lastDynamicId++;
  159. attribute = attrs.getNamedItem("name");
  160. if (attribute != null)
  161. zoneName = attribute.getNodeValue();
  162. else
  163. zoneName = null;
  164. attribute = attrs.getNamedItem("minZ");
  165. if (attribute != null)
  166. minZ = Integer.parseInt(attribute.getNodeValue());
  167. else
  168. {
  169. _log.warning("ZoneData: Missing minZ for zone: " + zoneId + " in file: " + f.getName());
  170. continue;
  171. }
  172. attribute = attrs.getNamedItem("maxZ");
  173. if (attribute != null)
  174. maxZ = Integer.parseInt(attribute.getNodeValue());
  175. else
  176. {
  177. _log.warning("ZoneData: Missing maxZ for zone: " + zoneId + " in file: " + f.getName());
  178. continue;
  179. }
  180. attribute = attrs.getNamedItem("type");
  181. if (attribute != null)
  182. zoneType = attribute.getNodeValue();
  183. else
  184. {
  185. _log.warning("ZoneData: Missing type for zone: " + zoneId + " in file: " + f.getName());
  186. continue;
  187. }
  188. attribute = attrs.getNamedItem("shape");
  189. if (attribute != null)
  190. zoneShape = attribute.getNodeValue();
  191. else
  192. {
  193. _log.warning("ZoneData: Missing shape for zone: " + zoneId + " in file: " + f.getName());
  194. continue;
  195. }
  196. // Create the zone
  197. Class<?> newZone;
  198. try
  199. {
  200. newZone = Class.forName("com.l2jserver.gameserver.model.zone.type.L2" + zoneType);
  201. }
  202. catch (ClassNotFoundException e)
  203. {
  204. _log.warning("ZoneData: No such zone type: " + zoneType + " in file: " + f.getName());
  205. continue;
  206. }
  207. Constructor<?> zoneConstructor = newZone.getConstructor(int.class);
  208. L2ZoneType temp = (L2ZoneType) zoneConstructor.newInstance(zoneId);
  209. // Get the zone shape from sql
  210. try
  211. {
  212. coords = null;
  213. int[] point;
  214. FastList<int[]> rs = FastList.newInstance();
  215. try
  216. {
  217. // loading from XML first
  218. for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
  219. {
  220. if ("node".equalsIgnoreCase(cd.getNodeName()))
  221. {
  222. attrs = cd.getAttributes();
  223. point = new int[2];
  224. point[0] = Integer.parseInt(attrs.getNamedItem("X").getNodeValue());
  225. point[1] = Integer.parseInt(attrs.getNamedItem("Y").getNodeValue());
  226. rs.add(point);
  227. }
  228. }
  229. // does not try to load dynamic zoneId from sql
  230. if (rs.size() == 0 && zoneId < 300000)
  231. {
  232. // loading from SQL
  233. try
  234. {
  235. statement.setInt(1, zoneId);
  236. ResultSet rset = statement.executeQuery();
  237. while (rset.next())
  238. {
  239. point = new int[2];
  240. point[0] = rset.getInt("x");
  241. point[1] = rset.getInt("y");
  242. rs.add(point);
  243. }
  244. rset.close();
  245. }
  246. finally
  247. {
  248. statement.clearParameters();
  249. }
  250. }
  251. coords = rs.toArray(new int[rs.size()][]);
  252. }
  253. finally
  254. {
  255. FastList.recycle(rs);
  256. }
  257. if (coords == null || coords.length == 0)
  258. {
  259. _log.warning("ZoneData: missing data for zone: " + zoneId +" in both XML and SQL, file: " + f.getName());
  260. continue;
  261. }
  262. // Create this zone. Parsing for cuboids is a
  263. // bit different than for other polygons
  264. // cuboids need exactly 2 points to be defined.
  265. // Other polygons need at least 3 (one per
  266. // vertex)
  267. if (zoneShape.equalsIgnoreCase("Cuboid"))
  268. {
  269. if (coords.length == 2)
  270. temp.setZone(new ZoneCuboid(coords[0][0], coords[1][0], coords[0][1], coords[1][1], minZ, maxZ));
  271. else
  272. {
  273. _log.warning("ZoneData: Missing cuboid vertex in sql data for zone: " + zoneId + " in file: " + f.getName());
  274. continue;
  275. }
  276. }
  277. else if (zoneShape.equalsIgnoreCase("NPoly"))
  278. {
  279. // nPoly needs to have at least 3 vertices
  280. if (coords.length > 2)
  281. {
  282. final int[] aX = new int[coords.length];
  283. final int[] aY = new int[coords.length];
  284. for (int i = 0; i < coords.length; i++)
  285. {
  286. aX[i] = coords[i][0];
  287. aY[i] = coords[i][1];
  288. }
  289. temp.setZone(new ZoneNPoly(aX, aY, minZ, maxZ));
  290. }
  291. else
  292. {
  293. _log.warning("ZoneData: Bad data for zone: " + zoneId + " in file: " + f.getName());
  294. continue;
  295. }
  296. }
  297. else if (zoneShape.equalsIgnoreCase("Cylinder"))
  298. {
  299. // A Cylinder zone requires a center point
  300. // at x,y and a radius
  301. attrs = d.getAttributes();
  302. final int zoneRad = Integer.parseInt(attrs.getNamedItem("rad").getNodeValue());
  303. if (coords.length == 1 && zoneRad > 0)
  304. temp.setZone(new ZoneCylinder(coords[0][0], coords[0][1], minZ, maxZ, zoneRad));
  305. else
  306. {
  307. _log.warning("ZoneData: Bad data for zone: " + zoneId + " in file: " + f.getName());
  308. continue;
  309. }
  310. }
  311. else
  312. {
  313. _log.warning("ZoneData: Unknown shape: " + zoneShape + " in file: " + f.getName());
  314. continue;
  315. }
  316. }
  317. catch (Exception e)
  318. {
  319. _log.log(Level.WARNING, "ZoneData: Failed to load zone " + zoneId + " coordinates: " + e.getMessage(), e);
  320. }
  321. // Check for additional parameters
  322. for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
  323. {
  324. if ("stat".equalsIgnoreCase(cd.getNodeName()))
  325. {
  326. attrs = cd.getAttributes();
  327. String name = attrs.getNamedItem("name").getNodeValue();
  328. String val = attrs.getNamedItem("val").getNodeValue();
  329. temp.setParameter(name, val);
  330. }
  331. else if ("spawn".equalsIgnoreCase(cd.getNodeName()) && temp instanceof L2SpawnZone)
  332. {
  333. attrs = cd.getAttributes();
  334. int spawnX = Integer.parseInt(attrs.getNamedItem("X").getNodeValue());
  335. int spawnY = Integer.parseInt(attrs.getNamedItem("Y").getNodeValue());
  336. int spawnZ = Integer.parseInt(attrs.getNamedItem("Z").getNodeValue());
  337. Node val = attrs.getNamedItem("isChaotic");
  338. if (val != null && Boolean.parseBoolean(val.getNodeValue()))
  339. ((L2SpawnZone) temp).addChaoticSpawn(spawnX, spawnY, spawnZ);
  340. else
  341. ((L2SpawnZone) temp).addSpawn(spawnX, spawnY, spawnZ);
  342. }
  343. }
  344. if (checkId(zoneId))
  345. _log.config("Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
  346. if (zoneName != null && !zoneName.isEmpty())
  347. temp.setName(zoneName);
  348. addZone(zoneId, temp);
  349. // Register the zone into any world region it
  350. // intersects with...
  351. // currently 11136 test for each zone :>
  352. int ax, ay, bx, by;
  353. for (int x = 0; x < worldRegions.length; x++)
  354. {
  355. for (int y = 0; y < worldRegions[x].length; y++)
  356. {
  357. ax = (x - L2World.OFFSET_X) << L2World.SHIFT_BY;
  358. bx = ((x + 1) - L2World.OFFSET_X) << L2World.SHIFT_BY;
  359. ay = (y - L2World.OFFSET_Y) << L2World.SHIFT_BY;
  360. by = ((y + 1) - L2World.OFFSET_Y) << L2World.SHIFT_BY;
  361. if (temp.getZone().intersectsRectangle(ax, bx, ay, by))
  362. {
  363. if (Config.DEBUG)
  364. {
  365. _log.info("Zone (" + zoneId + ") added to: " + x + " " + y);
  366. }
  367. worldRegions[x][y].addZone(temp);
  368. }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. }
  375. }
  376. }
  377. catch (Exception e)
  378. {
  379. _log.log(Level.SEVERE, "Error while loading zones.", e);
  380. return;
  381. }
  382. finally
  383. {
  384. L2DatabaseFactory.close(con);
  385. }
  386. _log.info("Done: loaded " + _classZones.size() + " zone classes and "+getSize()+" zones.");
  387. }
  388. public int getSize()
  389. {
  390. int i = 0;
  391. for (Map<Integer, ? extends L2ZoneType> map : _classZones.values())
  392. {
  393. i += map.size();
  394. }
  395. return i;
  396. }
  397. public boolean checkId(int id)
  398. {
  399. for (Map<Integer, ? extends L2ZoneType> map : _classZones.values())
  400. {
  401. if (map.containsKey(id))
  402. return true;
  403. }
  404. return false;
  405. }
  406. /**
  407. * Add new zone
  408. *
  409. * @param zone
  410. */
  411. @SuppressWarnings("unchecked")
  412. public <T extends L2ZoneType> void addZone(Integer id, T zone)
  413. {
  414. //_zones.put(id, zone);
  415. Map<Integer, T> map = (Map<Integer, T>) _classZones.get(zone.getClass());
  416. if (map == null)
  417. {
  418. map = new FastMap<Integer, T>();
  419. map.put(id, zone);
  420. _classZones.put(zone.getClass(), map);
  421. }
  422. else
  423. map.put(id, zone);
  424. }
  425. /**
  426. * Returns all zones registered with the ZoneManager.
  427. * To minimise iteration processing retrieve zones from L2WorldRegion for a specific location instead.
  428. * @return zones
  429. * @see #getAllZones(Class)
  430. */
  431. @Deprecated
  432. public Collection<L2ZoneType> getAllZones()
  433. {
  434. FastList<L2ZoneType> zones = new FastList<L2ZoneType>();
  435. for (Map<Integer, ? extends L2ZoneType> map : _classZones.values())
  436. {
  437. zones.addAll(map.values());
  438. }
  439. return zones;
  440. }
  441. /**
  442. * Return all zones by class type
  443. * @param <T>
  444. * @param zoneType Zone class
  445. * @return Collection of zones
  446. */
  447. @SuppressWarnings("unchecked")
  448. public <T extends L2ZoneType> Collection<T> getAllZones(Class<T> zoneType)
  449. {
  450. return (Collection<T>) _classZones.get(zoneType).values();
  451. }
  452. /**
  453. * Get zone by ID
  454. * @param id
  455. * @return
  456. * @see #getZoneById(int, Class)
  457. */
  458. public L2ZoneType getZoneById(int id)
  459. {
  460. for (Map<Integer, ? extends L2ZoneType> map : _classZones.values())
  461. {
  462. if (map.containsKey(id))
  463. return map.get(id);
  464. }
  465. return null;
  466. }
  467. /**
  468. * Get zone by ID and zone class
  469. * @param id
  470. * @param zoneType
  471. * @return zone
  472. */
  473. @SuppressWarnings("unchecked")
  474. public <T extends L2ZoneType> T getZoneById(int id, Class<T> zoneType)
  475. {
  476. return (T) _classZones.get(zoneType).get(id);
  477. }
  478. /**
  479. * Returns all zones from where the object is located
  480. *
  481. * @param object
  482. * @return zones
  483. */
  484. public FastList<L2ZoneType> getZones(L2Object object)
  485. {
  486. return getZones(object.getX(), object.getY(), object.getZ());
  487. }
  488. /**
  489. * Returns zone from where the object is located by type
  490. *
  491. * @param object
  492. * @param type
  493. * @return zone
  494. */
  495. public <T extends L2ZoneType> T getZone(L2Object object, Class<T> type)
  496. {
  497. if (object == null)
  498. return null;
  499. return getZone(object.getX(), object.getY(), object.getZ(), type);
  500. }
  501. /**
  502. * Returns all zones from given coordinates (plane)
  503. *
  504. * @param x
  505. * @param y
  506. * @return zones
  507. */
  508. public FastList<L2ZoneType> getZones(int x, int y)
  509. {
  510. L2WorldRegion region = L2World.getInstance().getRegion(x, y);
  511. FastList<L2ZoneType> temp = new FastList<L2ZoneType>();
  512. for (L2ZoneType zone : region.getZones())
  513. {
  514. if (zone.isInsideZone(x, y))
  515. temp.add(zone);
  516. }
  517. return temp;
  518. }
  519. /**
  520. * Returns all zones from given coordinates
  521. *
  522. * @param x
  523. * @param y
  524. * @param z
  525. * @return zones
  526. */
  527. public FastList<L2ZoneType> getZones(int x, int y, int z)
  528. {
  529. L2WorldRegion region = L2World.getInstance().getRegion(x, y);
  530. FastList<L2ZoneType> temp = new FastList<L2ZoneType>();
  531. for (L2ZoneType zone : region.getZones())
  532. {
  533. if (zone.isInsideZone(x, y, z))
  534. temp.add(zone);
  535. }
  536. return temp;
  537. }
  538. /**
  539. * Returns zone from given coordinates
  540. *
  541. * @param x
  542. * @param y
  543. * @param z
  544. * @param type
  545. * @return zone
  546. */
  547. @SuppressWarnings("unchecked")
  548. public <T extends L2ZoneType> T getZone(int x, int y, int z, Class<T> type)
  549. {
  550. L2WorldRegion region = L2World.getInstance().getRegion(x, y);
  551. for (L2ZoneType zone : region.getZones())
  552. {
  553. if (zone.isInsideZone(x, y, z) && type.isInstance(zone))
  554. return (T) zone;
  555. }
  556. return null;
  557. }
  558. public final L2ArenaZone getArena(L2Character character)
  559. {
  560. if (character == null)
  561. return null;
  562. for (L2ZoneType temp : ZoneManager.getInstance().getZones(character.getX(), character.getY(), character.getZ()))
  563. {
  564. if (temp instanceof L2ArenaZone && temp.isCharacterInZone(character))
  565. return ((L2ArenaZone) temp);
  566. }
  567. return null;
  568. }
  569. public final L2OlympiadStadiumZone getOlympiadStadium(L2Character character)
  570. {
  571. if (character == null)
  572. return null;
  573. for (L2ZoneType temp : ZoneManager.getInstance().getZones(character.getX(), character.getY(), character.getZ()))
  574. {
  575. if (temp instanceof L2OlympiadStadiumZone && temp.isCharacterInZone(character))
  576. return ((L2OlympiadStadiumZone) temp);
  577. }
  578. return null;
  579. }
  580. /**
  581. * For testing purposes only
  582. * @param <T>
  583. * @param obj
  584. * @param type
  585. * @return
  586. */
  587. @SuppressWarnings("unchecked")
  588. public <T extends L2ZoneType> T getClosestZone(L2Object obj, Class<T> type)
  589. {
  590. T zone = getZone(obj, type);
  591. if (zone == null)
  592. {
  593. double closestdis = Double.MAX_VALUE;
  594. for (T temp : (Collection<T>) _classZones.get(type).values())
  595. {
  596. double distance = temp.getDistanceToZone(obj);
  597. if (distance < closestdis)
  598. {
  599. closestdis = distance;
  600. zone = temp;
  601. }
  602. }
  603. return zone;
  604. }
  605. else
  606. return zone;
  607. }
  608. /**
  609. * General storage for debug items used for visualizing zones.
  610. * @return list of items
  611. */
  612. public List<L2ItemInstance> getDebugItems()
  613. {
  614. if (_debugItems == null)
  615. _debugItems = new FastList<L2ItemInstance>();
  616. return _debugItems;
  617. }
  618. /**
  619. * Remove all debug items from l2world
  620. */
  621. public void clearDebugItems()
  622. {
  623. if (_debugItems != null)
  624. {
  625. Iterator<L2ItemInstance> it = _debugItems.iterator();
  626. while (it.hasNext())
  627. {
  628. L2ItemInstance item = it.next();
  629. if (item != null)
  630. item.decayMe();
  631. it.remove();
  632. }
  633. }
  634. }
  635. @SuppressWarnings("synthetic-access")
  636. private static class SingletonHolder
  637. {
  638. protected static final ZoneManager _instance = new ZoneManager();
  639. }
  640. }