コード例 #1
0
 private void addXmiModel(
     Extent extent, Package metaModel, String xmiFileName, int type, boolean createExtent)
     throws IOException, XmiException, hub.sam.mof.instancemodel.MetaModelException {
   File xmiFile = new File(xmiFileName);
   InputStreamReader reader = new InputStreamReader(new FileInputStream(xmiFile));
   ByteArrayOutputStream out = new ByteArrayOutputStream();
   int read = reader.read();
   while (read != -1) {
     out.write(read);
     read = reader.read();
   }
   try {
     if (!createExtent) {
       remote.addXmiModel(
           ((ClientExtentImpl) extent).getRemoteExtent(),
           getServerObjectFromLocalValue((ClientObject) metaModel),
           out.toByteArray(),
           xmiFileName,
           type,
           createExtent);
     } else {
       remote.addXmiModel(null, null, out.toByteArray(), xmiFileName, type, createExtent);
     }
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   } catch (JDOMException e) {
     throw new RuntimeException(e);
   }
 }
コード例 #2
0
 public void deleteExtent(String name) {
   try {
     remote.deleteExtent(name);
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }
コード例 #3
0
 public Extent createExtent(String name) {
   try {
     return new ClientExtentImpl(remote.createExtent(name));
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }
コード例 #4
0
 public void reset() {
   try {
     remote.reset();
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }
コード例 #5
0
 @SuppressWarnings("unchecked")
 public Collection<String> getExtentNames() {
   try {
     return remote.getExtentNames();
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }
コード例 #6
0
 public void addStaticModel(String staticModelClassName)
     throws SecurityException, NoSuchMethodException, ClassNotFoundException {
   try {
     remote.addStaticModel(staticModelClassName);
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }
コード例 #7
0
 public Factory createFactory(Extent forExtent, Object forPackage) {
   try {
     return ClientFactoryImpl.createClientFactory(
         remote.createFactory(
             ((ClientExtentImpl) forExtent).getRemoteExtent(),
             getServerObjectFromLocalValue((ClientObject) forPackage)));
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }
コード例 #8
0
 public Extent getExtent(String name) {
   try {
     ServerExtent serverExtent = remote.getExtent(name);
     if (serverExtent == null) {
       return null;
     } else {
       return new ClientExtentImpl(serverExtent);
     }
   } catch (RemoteException e) {
     throw new RuntimeException(e);
   }
 }