public PersistLatestServiceConfigurationAdapter(final ReconfigurableService service, final Long serviceConfigObjId, final ArchiveInheritanceSkeleton archiveService, final ExecutorService executor) { try { ConfigurationHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // if it was already initialized, then.. cool bro! } try { DirectoryHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // if it was already initialized, then.. cool bro! } this.archiveService = archiveService; this.serviceConfigObjId = serviceConfigObjId; this.executor = executor; }
public AppsLauncherManager(COMServicesProvider comServices) { super(comServices); // If there is a property for that, then use it!! if (System.getProperty(FOLDER_LOCATION_PROPERTY) != null) { apps_folder_path = new File(System.getProperty(FOLDER_LOCATION_PROPERTY)); } runnable_filename = osValidator.isWindows() ? RUN_WIN_FILENAME : RUN_LIN_FILENAME; try { AppsLauncherHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } if (super.getArchiveService() == null) { // No Archive? this.uniqueObjIdDef = new AtomicLong(0); } else { // With Archive... } }
public ConversionConsumerServiceImpl() { try { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(MCHelper.MC_AREA_NAME, MCHelper.MC_AREA_VERSION) == null) { MCHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { ConversionHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } } catch (MALException ex) { Logger.getLogger(ConversionConsumerServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } }
public GroupConsumerServiceImpl() throws MALException { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(MCHelper.MC_AREA_NAME, MCHelper.MC_AREA_VERSION) == null) { MCHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { GroupHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } } }
/** * Initializes the service * * @param archiveService Archive service provider * @param eventService Event service provider * @throws MALException On initialization error. */ public synchronized void init(ArchiveProviderServiceImpl archiveService, EventProviderServiceImpl eventService) throws MALException { if (!initialiased) { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { ActivityTrackingHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { } } this.archiveService = archiveService; this.eventService = eventService; running = true; initialiased = true; Logger.getLogger(ActivityTrackingProviderServiceImpl.class.getName()).info("Activity Tracking service READY"); }
/** * Generates the corresponding MAL Element from a certain MAL Element List * * @param obj The MAL Element List * @return The MAL Element * @throws java.lang.Exception */ public static Element elementList2element(ElementList obj) throws Exception { if (obj == null) { return null; } long l = obj.getShortForm(); long ll = (-((l) & 0xFFFFFFL)) & 0xFFFFFFL + (l & 0xFFFFFFFFFF000000L); MALElementFactory eleFact = MALContextFactory.getElementFactoryRegistry().lookupElementFactory(ll); if (eleFact == null) { Logger.getLogger(HelperMisc.class.getName()).log(Level.SEVERE, "The element could not be found in the MAL ElementFactory! The object type is: '" + obj.getClass().getSimpleName() + "'. Maybe the service Helper for this object was not initialized. " + "Try initializing the Service Helper of this object."); } return (Element) eleFact.createElement(); }
public ParameterManager(COMServicesProvider comServices, ParameterStatusListener parametersMonitoring) { super(comServices); try { ParameterHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } this.parametersMonitoring = parametersMonitoring; if (super.getArchiveService() == null) { // No Archive? this.uniqueObjIdIdentity = new Long(0); // The zeroth value will not be used (reserved for the wildcard) this.uniqueObjIdDef = new Long(0); // The zeroth value will not be used (reserved for the wildcard) this.uniqueObjIdPVal = new Long(0); // The zeroth value will not be used (reserved for the wildcard) // this.load(); // Load the file } else { // With Archive... // Initialize the Conversion service try { this.conversionService.init(super.getArchiveService()); } catch (MALException ex) { Logger.getLogger(ParameterManager.class.getName()).log(Level.SEVERE, null, ex); } } }
/** * * @param archiveService * @throws org.ccsds.moims.mo.mal.MALException */ protected synchronized void init(ArchiveProviderServiceImpl archiveService) throws MALException { this.archiveService = archiveService; if (!initialiased) { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.deepInit(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(MCHelper.MC_AREA_NAME, MCHelper.MC_AREA_VERSION) == null) { MCHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { ConversionHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } } initialiased = true; }
/** * * @param archiveService * @throws org.ccsds.moims.mo.mal.MALException */ protected synchronized void init(ArchiveProviderServiceImpl archiveService) throws MALException { this.archiveService = archiveService; if (!initialiased) { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.deepInit(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(MCHelper.MC_AREA_NAME, MCHelper.MC_AREA_VERSION) == null) { MCHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { GroupHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } } initialiased = true; }
/** * Generates the corresponding MAL Element List from a certain MAL Element * * @param obj The MAL Element * @return The MAL Element List * @throws java.lang.Exception */ public static ElementList element2elementList(Object obj) throws Exception { if (obj == null) { return null; } if (obj instanceof Element) { long l = ((Element) obj).getShortForm(); long ll = (-((l) & 0xFFFFFFL)) & 0xFFFFFFL + (l & 0xFFFFFFFFFF000000L); MALElementFactory eleFact = MALContextFactory.getElementFactoryRegistry().lookupElementFactory(ll); if (eleFact == null) { Logger.getLogger(HelperMisc.class.getName()).log(Level.SEVERE, "The element could not be found in the MAL ElementFactory! The object type is: '" + obj.getClass().getSimpleName() + "'. Maybe the service Helper for this object was not initialized. " + "Try initializing the Service Helper of this object."); } return (ElementList) eleFact.createElement(); } else { return HelperAttributes.generateElementListFromJavaType(obj); } }
/** * creates the MAL objects, the publisher used to create updates and starts * the publishing thread * * @param manager the Archive Manager * @throws MALException if initialization error. */ public synchronized void init(ArchiveManager manager) throws MALException { if (!initialiased) { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { ArchiveSyncHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { } } this.manager = manager; // shut down old service transport if (null != archiveSyncServiceProvider) { connection.closeAll(); } archiveSyncServiceProvider = connection.startService(ArchiveSyncHelper.ARCHIVESYNC_SERVICE_NAME.toString(), ArchiveSyncHelper.ARCHIVESYNC_SERVICE, false, this); running = true; initialiased = true; Logger.getLogger(ArchiveSyncProviderServiceImpl.class.getName()).info("ArchiveSync service READY"); }
public Object getObject() { Element elem = null; if (this.obj != null) { try { final BinaryDecoder binDec = new BinaryDecoder(this.obj); final MALElementFactory eleFact = MALContextFactory.getElementFactoryRegistry().lookupElementFactory(binDec.decodeLong()); elem = binDec.decodeNullableElement((Element) eleFact.createElement()); } catch (MALException ex) { Logger.getLogger(COMObjectEntity.class.getName()).log(Level.SEVERE, "The object body could not be decoded! Usually happens when there's " + "an update in the APIs. (1) " + this.toString(), ex); } catch (IllegalArgumentException ex) { Logger.getLogger(COMObjectEntity.class.getName()).log(Level.SEVERE, "The object body could not be decoded! Usually happens when there's " + "an update in the APIs. (2) " + this.toString(), ex); } catch (Exception ex) { Logger.getLogger(COMObjectEntity.class.getName()).log(Level.SEVERE, "The object body could not be decoded! Usually happens when there's " + "an update in the APIs. (3) " + this.toString(), ex); } } return HelperAttributes.attribute2JavaType(elem); }
if (!initialiased) { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); COMHelper.init(MALContextFactory.getElementFactoryRegistry()); ArchiveHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) {
public MemoryManagementConsumerServiceImpl(SingleConnectionDetails connectionDetails, COMServicesConsumer comServices) throws MALException, MalformedURLException, MALInteractionException { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); COMHelper.init(MALContextFactory.getElementFactoryRegistry()); SoftwareManagementHelper.init(MALContextFactory.getElementFactoryRegistry()); MemoryManagementHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) {
public SoftwareImageConsumerServiceImpl(SingleConnectionDetails connectionDetails, COMServicesConsumer comServices) throws MALException, MalformedURLException, MALInteractionException { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); COMHelper.init(MALContextFactory.getElementFactoryRegistry()); SoftwareManagementHelper.init(MALContextFactory.getElementFactoryRegistry()); SoftwareImageHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) {
protected Object decodeSubElement(final Long shortForm, final MALEncodingContext ctx) throws MALException { if (null == shortForm) { return null; } final MALElementFactory ef = MALContextFactory.getElementFactoryRegistry().lookupElementFactory(shortForm); if (null == ef) { throw new MALException("GEN transport unable to find element factory for short type: " + shortForm); } return dec.decodeElement((Element) ef.createElement()); } }
public ArchiveConsumerServiceImpl(SingleConnectionDetails connectionDetails) throws MALException, MalformedURLException { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { ArchiveHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { } this.connectionDetails = connectionDetails; // Close old connection if (tmConsumer != null) { try { tmConsumer.close(); } catch (MALException ex) { Logger.getLogger(ArchiveConsumerServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } } tmConsumer = connection.startService( this.connectionDetails.getProviderURI(), this.connectionDetails.getBrokerURI(), this.connectionDetails.getDomain(), ArchiveHelper.ARCHIVE_SERVICE); this.archiveService = new ArchiveStub(tmConsumer); }
public ArchiveSyncConsumerServiceImpl(SingleConnectionDetails connectionDetails) throws MALException, MalformedURLException { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { ArchiveSyncHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { } this.connectionDetails = connectionDetails; // Close old connection if (tmConsumer != null) { try { tmConsumer.close(); } catch (MALException ex) { Logger.getLogger(ArchiveSyncConsumerServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } } tmConsumer = connection.startService( this.connectionDetails.getProviderURI(), this.connectionDetails.getBrokerURI(), this.connectionDetails.getDomain(), ArchiveSyncHelper.ARCHIVESYNC_SERVICE); this.archiveSyncService = new ArchiveSyncStub(tmConsumer); }
/** * Decodes a single part of the message body. * * @param meel The encoded element list. * @return The decoded chunk. * @throws MALException if any error detected. */ protected Object decodeEncodedElementListBodyPart(final MALEncodedElementList meel) throws MALException { long sf = (Long) meel.getShortForm(); final MALElementFactory ef = MALContextFactory.getElementFactoryRegistry().lookupElementFactory(sf); if (null == ef) { throw new MALException("GEN transport unable to find element factory for short type: " + sf); } // create list of correct type long lsf = (-((sf) & 0xFFFFFFL)) & 0xFFFFFFL + (sf & 0xFFFFFFFFFF000000L); ElementList rv = (ElementList) MALContextFactory.getElementFactoryRegistry().lookupElementFactory(lsf).createElement(); for (MALEncodedElement ele : meel) { final ByteArrayInputStream lbais = new ByteArrayInputStream(ele.getEncodedElement().getValue()); MALElementInputStream lenc = encFactory.createInputStream(lbais); rv.add(lenc.readElement(ef.createElement(), ctx)); } return rv; }
/** * Initializes the Archive manager * * @param eventService The Event service provider. */ public ArchiveManager(EventProviderServiceImpl eventService) { this.eventService = eventService; try { ArchiveHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { } this.dbBackend = new DatabaseBackend(); this.dbProcessor = new TransactionsProcessor(dbBackend); // Start the separate lists for the "fast" generation of objIds this.fastDomain = new FastDomain(dbBackend); this.fastNetwork = new FastNetwork(dbBackend); this.fastProviderURI = new FastProviderURI(dbBackend); this.fastObjId = new FastObjId(dbBackend); this.fastObjectType = new FastObjectType(dbBackend); }