Без темы
<<  Java Multimedia: Images, Animation, Audio and Video JEG DM: progress in DM  >>
Event notification in JavaSpaces
Event notification in JavaSpaces
Картинки из презентации «JavaSpacesTM» к уроку английского языка на тему «Без темы»

Автор: Stephan J. Roorda. Чтобы познакомиться с картинкой полного размера, нажмите на её эскиз. Чтобы можно было использовать все картинки для урока английского языка, скачайте бесплатно презентацию «JavaSpacesTM.ppt» со всеми картинками в zip-архиве размером 176 КБ.

JavaSpacesTM

содержание презентации «JavaSpacesTM.ppt»
Сл Текст Сл Текст
1JavaSpacesTM. By Stephan Roorda 23RemoteEventListener listener, long lease,
Source: JavaSpaces specification. MarshalledObject handback ) }.
2Presentation Outline. Review of Linda 24Accessing a JavaSpace. Space might be
Overview of JavaSpaces In depth registered as a Jini lookup service Space
description of JavaSpaces Why is might register with an RMI registry.
JavaSpaces better? 25Operations. Write Read Take Notify.
3Review of Linda. 26write. Write the given entry into this
4Linda Basics. Tuple space is Linda's JavaSpaces service public void writeShip(
name for its shared data space A Tuple is SpaceShip ship ) { try { space.write(
simply a list of fields, separated by ship, null, Lease.FOREVER ); } catch(
commas and enclosed in parentheses A tuple Exception e ) { e.printStackTrace(); } }.
is accessed by specifying its contents 27read and readIfExists. Read an entry
Associative memory model There is no from the JavaSpaces service that matches
address associated with a tuple. the given template Passing a null
5Tuple Space. Sender. Sender. Tuple reference for the template will match any
Space. Receiver. Receiver. Entry Multiple read requests may return
6Linda Operations. There are four basic different Entry objects even if no changes
operations: out Generates a data (passive) are made to the space in between each.
tuple. Each field is evaluated and put 28read and readIfExists. public int
into tuple space. in Uses a template to getScore( String name ) { SpaceShip
retrieve tuple from tuple space Once template = new SpaceShip(); template.name
retrieved, the tuple is taken out of tuple = name; try { SpaceShip ship =
space and is no longer If no matching (SpaceShip)space.read( template, null,
tuple is found process will block. Long.Max_VALUE ); return
Provides for synchronization between ship.score.intValue(); } catch( Exception
processes. e ) { e.printStackTrace(); return -1; } }.
7Linda Templates. Specifies tuple to 29Silly Sample. public static void main(
retrieve Consists of sequence of typed String args[] ) { JavaSpace space =
fields Two kinds of fields Actuals SpaceAccessor.getSpace(); SpaceGame game =
Variables, constants or expression that new SpaceGame( space ); // create an entry
resolve to constant Formals Holders for SpaceShip enterprise = new SpaceShip(
data to retrieve Preceded by a question “enterprise”, 10 ); // demonstrate read
mark Assigned values of corresponding and write game.writeShip( enterprise );
fields in matched tuple. System.out.println(enterprise.name + “
8Matching Templates. In order for a written into space”);
template to match a tuple: Have to have System.out.println(“The “ +
the same number of fields Actuals must enterprise.name + “’s score is “ +
have same type, length and values as those game.getScore(“enterprise”) ); }.
in corresponding tuple fields Formals in 30take and takeIfExists. Same as Read
template must match type and length of operations, except that the entry is
corresponding fields in tuple If several removed from the space Will never return
tuples match the template, impossible to copies of the same Entry.
predict which will be selected The order 31take and Exceptions. RemoteException -
of evaluation of fields within a tuple or may or may not have been successful
template is undefined. UnusableEntryException - removes the
9Linda Operations. rd Uses a template unusable entry from the space Any other
to copy data without removing it from exception - take did not occur and no
tuple space. Once read, the tuple is still entry was removed from the space.
available for others. If no matching tuple 32notify. Notify a specific object when
is found process will block. eval entries that match the given template are
Generates process (active) tuple Control written into this JavaSpaces service A
is immediately returned to invoking lease time is given which is how long you
program Logically, each field is evaluated want the registration to be remembered by
concurrently, by a separate process and the server.
then placed into tuple space. 33Events in Java. Event Source Event
10Quote. Object Event Listener.
11Overview of JavaSpaces. 34Distributed Events in JavaSpaces.
12Mapping Linda to JavaSpaces. JavaSpace Events might have to travel from one JVM
= Tuple Space entry = tuple write = out to another over a network Events may
take = in read = rd. arrive: multiple times out of order not at
13Differences between Linda and all Programmer’s responsibility to ensure
JavaSpaces. Entries in Java are typed as correctness.
objects associates behavior with entries 35Event notification in JavaSpaces.
JavaSpaces allows matching of subtypes 36Notification Example. public static
result of having typed entries Fields in void main( String args[] ) { JavaSpace
an entry are objects in Java systems built space = SpaceAccessor.getSpace(); Listener
with this are object-oriented. listener = new Listener( space ); Message
14Differences. Support for multiple template = new Message();
JavaSpaces transactions can span multiple space.notify(template, null, listener,
threads and spaces Leasing frees system Lease.FOREVER, null); Message msg = new
from garbage left behind from crashes Message(); msg.content = “Hello World”;
JavaSpaces does not provide eval. space.write( msg, null, Lease.FOREVER );
15JavaSpaces Design Goals. Provide a }.
simple platform for designing and 37Notification Example. public class
implementing distributed systems Thin Listener implement RemoteEventListener {
clients simple quick to download run on private JavaSpace space; public Listener(
limited local memory. JavaSpace space ) throws RemoteException {
16JavaSpaces Design Goals. Variety of this.space = space;
server implementations relational UnicastRemoteObject.exportObject( this );
databases object oriented databases It } public void notify( RemoteEvent ev ) {
should be possible to create a replicated Message result = (Message)space.read(
JavaSpaces service. template, null, Long.MAX_VALUE );
17Requirements for Application Clients. System.out.println( result.content ); } }.
Must be possible to write a 100% Pure Java 38notify and Transactions. Transactions
client Clients implementation must be can be: null non - null.
independent of the implementation details 39notify and Transactions. entries that
of the Server. are written and taken in the same
18Key features of JavaSpaces. Spaces are transaction - before a commit - listeners
shared handles the details of concurrent will not be notified that are registered
access Spaces are persistent objects can under a null transaction server retries
outlive the processes that created them until the notification request’s lease
Spaces are associative associative lookup expires notifications may be delivered in
is used to locate objects this is based on any order.
content and not memory location. 40Operation Ordering. operations on a
19Key features. Spaces are space are unordered Example: if T and U
transactionally secure transaction model are 2 threads. T performs a write and U
ensures that an operation on a space is performs a read with a template that
atomic supported for one or more spaces matches the written entry, the read may
Spaces allow us to exchange executable not find the written entry even if the
content objects are passive in the space( write returns before the read. The only
immutable ) when removed we can change way to guarantee this is if the threads
their attributes and invoke methods on work together and that is independent of
them. JavaSpaces.
20Entry. Collection of typed objects 41Transactions. uses
package net.jini.core.entry; public net.jini.core.transaction to group
interface Entry extends operations into a bundle that act as a
java.io.Serializable { // this interface single transaction either all operations
is empty }. within the transaction complete or none do
21Example Entry. import null - performs as if a transaction was
net.jini.core.entry.*; public class created just for that operation.
SpaceShip implements Entry { public 42Benefits of JavaSpaces. Simple
Integer score; public String name; public Expressive Supports loosely coupled
MessageEntry() { } public SpaceShip( protocols Eases the implementation of
String n, int s ) { score = s; name = n; } client/server systems.
}. 43Applications of JavaSpaces. Any
22JavaSpace Interface. All of the system/problem that needs a distributed
operations have to be invoked on an object solution Human Genome project Cryptography
that implements the JavaSpace interface Rendering Chat program Auction server(
Not a remote interface Exports objects such as e-bay, amazon, etc ).
that implement the JavaSpace interface 44Examples.
locally on the client. 45Conclusion. Simple to learn Easy to
23JavaSpace Interface. package understand Map a lot of problems fairly
net.jini.space; <import statements> new - not many “real-world” uses yet best
public interface JavaSpace { public final implementation of Linda yet.
long NO_WAIT = 0; Lease write( Entry e, 46References and Sources. JavaSpaces
Transaction txn, long lease ) Entry read( Principles, Patterns, and Practice by
Entry tmpl, Transaction txn, long timeout Freeman, Hupfer, Arnold Official
) Entry take( Entry tmpl, Transaction txn, JavaSpaces specification visit
long timeout ) EventRegistration notify( http://www.cs.rit.edu/~sjr1521 for full
Entry tmpl, Transaction txn, links and bibliography.
JavaSpacesTM.ppt
http://900igr.net/kartinka/anglijskij-jazyk/javaspacestm-63730.html
cсылка на страницу

JavaSpacesTM

другие презентации на тему «JavaSpacesTM»

«Суффиксы английских прилагательных» - Образование прилагательных. Read out the words with this sounds. Образуйте прилагательные от существительных. Признак основы. Признак книжной лексики. Словообразовательные суффиксы. Вспомни значение аффикса. Суффиксы прилагательных. Качество. Образуйте прилагательные с помощью суффиксов.

«ИКТ на уроках английского» - ИКТ в обучении английскому языку. Информация об ИКТ. Помощь в соотнесении прописных и строчных букв. Использование технических средств на уроке. Информация и упражнения о России. Онлайн-тесты и подготовка к итоговой аттестации. Методические особенности использования ИКТ в обучении английскому языку.

«Особенности английского языка» - Материалы исследования: Решены задачи: Внутренний круг. Внешний круг. Сравнение двух статей – описание новинки авторынка Lamborghini Murcielano: Политические Экономические Культурные Исторические Социальные. Схема распространения английского языка. Выявлены лингвокультурологические особенности развития лексики английского языка.

«Joanne Rowling» - С 2004 года Джоан Роулинг является самой богатой женщиной в Великобритании. Joanne Rowling. Роулинг заявила, что не исключает, что напишет продолжение серии. К пяти годам Джоанна едва ли не наизусть знала все детские книжки. В 2001 году Роулинг была награждена орденом Британской Империи. Джоан Роулинг является обладательницей множества престижных литературных премий.

«Русские и английские числительные» - По составу имена числительные делятся на: Наши подсчёты: Вывод: Простые производные составные. Составные числительные. Новое русское слово: Производные числительные. Например: twenty-one двадцать один, forty-seven сорок семь. Проект Числительные и меры: математическое многоборье. Точка в русской системе указывает на разряд числа.

«Личное письмо на английском языке» - Требования к объему. Письмо необходимо разделить на абзацы. Можно извиниться , что не писали раньше. What are you going to do in summer. Почему мы заканчиваем письмо. Письмо: секрет успеха. Не забудьте упомянуть о дальнейших контактах. Задание С1:личное письмо. Ответы на вопросы. Даны ли ответы на все вопросы.

Без темы

661 презентация
Урок

Английский язык

29 тем
Картинки