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); } }
public void deleteExtent(String name) { try { remote.deleteExtent(name); } catch (RemoteException e) { throw new RuntimeException(e); } }
public Extent createExtent(String name) { try { return new ClientExtentImpl(remote.createExtent(name)); } catch (RemoteException e) { throw new RuntimeException(e); } }
public void reset() { try { remote.reset(); } catch (RemoteException e) { throw new RuntimeException(e); } }
@SuppressWarnings("unchecked") public Collection<String> getExtentNames() { try { return remote.getExtentNames(); } catch (RemoteException e) { throw new RuntimeException(e); } }
public void addStaticModel(String staticModelClassName) throws SecurityException, NoSuchMethodException, ClassNotFoundException { try { remote.addStaticModel(staticModelClassName); } catch (RemoteException e) { throw new RuntimeException(e); } }
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); } }
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); } }