Examples of InstanceInvocationHandler


Examples of com.buschmais.cdo.impl.proxy.entity.InstanceInvocationHandler

    private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
        DatastoreId id = getDatastoreId(datastoreType);
        TypeMetadataSet<?> types = getTypes(datastoreType);
        Object instance = cache.get(id, cacheMode);
        if (instance == null) {
            InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler(datastoreType, getProxyMethodService());
            instance = proxyFactory.createInstance(invocationHandler, types.toClasses(), CompositeObject.class);
            cache.put(id, instance, cacheMode);
            if (TransactionalCache.Mode.READ.equals(cacheMode)) {
                instanceListenerService.postLoad(instance);
            }
View Full Code Here

Examples of com.buschmais.cdo.impl.proxy.instance.InstanceInvocationHandler

        }
        TypeMetadataSet<?> types = metadataProvider.getTypes(discriminators);
        EntityId id = datastoreSession.getId(entity);
        Object instance = cache.get(id);
        if (instance == null) {
            InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler(entity, proxyMethodService);
            instance = createInstance(invocationHandler, types.toClasses(), CompositeObject.class);
            cache.put(id, instance);
        }
        return (T) instance;
    }
View Full Code Here

Examples of com.buschmais.xo.impl.proxy.InstanceInvocationHandler

     * @param <T>     The type.
     * @return The example.
     */
    private <T> Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> prepareExample(Example<T> example, Class<?> type, Class<?>... types) {
        Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> exampleEntity = new HashMap<>();
        InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler(exampleEntity, new ExampleProxyMethodService(type, sessionContext));
        List<Class<?>> effectiveTypes = new ArrayList<>();
        effectiveTypes.add(type);
        effectiveTypes.addAll(Arrays.asList(types));
        T instance = sessionContext.getProxyFactory().createInstance(invocationHandler, effectiveTypes.toArray(new Class<?>[effectiveTypes.size()]),
                CompositeObject.class);
View Full Code Here

Examples of com.buschmais.xo.impl.proxy.InstanceInvocationHandler

    private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
        DatastoreId id = getDatastoreId(datastoreType);
        TypeMetadataSet<?> types = getTypes(datastoreType);
        Object instance = cache.get(id, cacheMode);
        if (instance == null) {
            InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler(datastoreType, getProxyMethodService());
            instance = proxyFactory.createInstance(invocationHandler, types.toClasses(), CompositeObject.class);
            cache.put(id, instance, cacheMode);
            if (TransactionalCache.Mode.READ.equals(cacheMode)) {
                instanceListenerService.postLoad(instance);
            }
View Full Code Here

Examples of com.buschmais.xo.impl.proxy.entity.InstanceInvocationHandler

    private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
        DatastoreId id = getDatastoreId(datastoreType);
        TypeMetadataSet<?> types = getTypes(datastoreType);
        Object instance = cache.get(id, cacheMode);
        if (instance == null) {
            InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler(datastoreType, getProxyMethodService());
            instance = proxyFactory.createInstance(invocationHandler, types.toClasses(), CompositeObject.class);
            cache.put(id, instance, cacheMode);
            if (TransactionalCache.Mode.READ.equals(cacheMode)) {
                instanceListenerService.postLoad(instance);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.