Package com.buschmais.xo.api

Examples of com.buschmais.xo.api.XOException


            XOManagerFactory xoManagerFactory = XOBootstrapService.createXOManagerFactory(name);
            if (xoManagerFactory != null) {
                return xoManagerFactory;
            }
        }
        throw new XOException("Cannot bootstrap XO implementation.");
    }
View Full Code Here


            XOManagerFactory xoManagerFactory = XOBootstrapService.createXOManagerFactory(xoUnit);
            if (xoManagerFactory != null) {
                return xoManagerFactory;
            }
        }
        throw new XOException("Cannot bootstrap XO implementation.");
    }
View Full Code Here

    @Override
    public Datastore<?, EntityMetadata, EntityDiscriminator, RelationMetadata, RelationDiscriminator> createDatastore(XOUnit xoUnit) {
        Properties properties = xoUnit.getProperties();
        String delegateProviderName = properties.getProperty(DELEGATE_KEY);
        if (delegateProviderName == null) {
            throw new XOException("Property '" + DELEGATE_KEY + "' must be specified using the class name of a data store provider.");
        }
        Class<XODatastoreProvider> delegateProviderType = ClassHelper.getType(delegateProviderName);
        XODatastoreProvider<EntityMetadata, EntityDiscriminator, RelationMetadata, RelationDiscriminator> delegateProvider = ClassHelper.newInstance(delegateProviderType);
        Datastore<?, EntityMetadata, EntityDiscriminator, RelationMetadata, RelationDiscriminator> delegateDatastore = delegateProvider.createDatastore(xoUnit);
        TraceMonitor traceMonitor = new TraceMonitor(xoUnit);
View Full Code Here

    public void init(Collection registeredMetadata) {
        ObjectName objectName = getObjectName();
        try {
            getMBeanServer().registerMBean(traceMonitor, objectName);
        } catch (JMException e) {
            throw new XOException("Cannot register trace monitor MBean for object name " + objectName, e);
        }
        delegate.init(registeredMetadata);
    }
View Full Code Here

        delegate.close();
        ObjectName objectName = getObjectName();
        try {
            getMBeanServer().unregisterMBean(objectName);
        } catch (JMException e) {
            throw new XOException("Cannot unregister trace monitor MBean for object name " + objectName, e);
        }
    }
View Full Code Here

    private ObjectName getObjectName() {
        String name = traceMonitor.getXOUnit().getName();
        try {
            return new ObjectName("com.buschmais.xo.trace","xo-unit", name);
        } catch (MalformedObjectNameException e) {
            throw new XOException("Cannot create object name for XO unit " + name, e);
        }

    }
View Full Code Here

                break;
            case ERROR:
                LOGGER.error(message);
                break;
            default:
                throw new XOException("Unsupported log log level " + level);
        }
    }
View Full Code Here

    @Override
    public Datastore<JsonFileStoreSession, JsonNodeMetadata, String, JsonRelationMetadata, String> createDatastore(XOUnit xoUnit) {
        URI uri = xoUnit.getUri();
        if (!"file".equals(uri.getScheme())) {
            throw new XOException("Only file URIs are supported by this store.");
        }
        try {
            return new JsonFileStore(uri.toURL().getPath());
        } catch (MalformedURLException e) {
            throw new XOException("Cannot convert URI '" + uri.toString() + "' to URL.", e);
        }
    }
View Full Code Here

    @Override
    public void deleteEntity(ObjectNode entity) {
        File file = getFile(entity);
        if (!file.exists()) {
            throw new XOException("Cannot deleteEntity entity '" + entity + "' as it does not exist.");
        }
        file.delete();
    }
View Full Code Here

    public void flushEntity(ObjectNode objectNode) {
        File file = getFile(objectNode);
        try {
            mapper.writeValue(new FileWriter(file), objectNode);
        } catch (IOException e) {
            throw new XOException("Cannot write file " + file.getName());
        }
    }
View Full Code Here

TOP

Related Classes of com.buschmais.xo.api.XOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.