All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.ode.jacob.JacobThread Maven / Gradle / Ivy

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.ode.jacob;

import java.lang.reflect.Method;

/**
 * Class exposing the JACOB operations.
 * 

* Note: these operations represent a subset of a process algebra mapped into * Java invocations; other aspects of the syntax are represented natively in Java. * In particular, parallel composition is modelled as sequential Java invocation * and if-else are modelled using Java's if-else statement. Note also that the * scoping rules for channel names are simply the Java object visibility rules. */ public interface JacobThread { public Object getExtension(Class extensionClass); public String exportChannel(Channel channel); public Channel importChannel(String channelId, Class channelClass); /** * Create a process instance i.e. a concretion of a process abstraction. */ public void instance(JacobRunnable concretion); /** * Send a message (object invocation). This method shouldn't really be used * as {@link Channel} objects may be used as proxies in this respect. * * @param channel * channel on which to send the message * @param method * method to apply * @param args * arguments */ public Channel message(Channel channel, Method method, Object[] args); /** * Create a new channel. */ public Channel newChannel(Class channelType, String creator, String description); /** *

* Receive a message on a channel, allowing for possible replication. The * effect of this method is to register a listener (the method list) for a * message on the channel to consume either one or an infinate number of * messages on the channel (depending on the value of the * replicate argument. *

* *

* With respect to process terms, the Java expression object(false, x, * ChannelListener) * corresponds to the process term x ? { ChannelListener }; * if in the same expression the initial replicate parameter * were instead set to true, corresponding term would be * ! x ? { ChannelListener }. *

* * @param replicate * if set the a replication operator is present * @param methodList * object representation of the method list * @throws IllegalArgumentException * if the method list does not match the channel kind */ public void object(boolean replicate, ChannelListener methodList) throws IllegalArgumentException; public void object(boolean reaplicate, ChannelListener[] methodLists) throws IllegalArgumentException; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy